@titaui/pc 1.10.4 → 1.10.6-3.beta-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/.eslintrc.js +2 -2
- package/.prettierignore +1 -1
- package/lib/components/book-demo/utils.js +4 -0
- package/lib/components/button/default-button/index.css +10 -4
- package/lib/components/button/default-button/index.js +13 -2
- package/lib/components/change-okr-modal/index.js +108 -87
- package/lib/components/checkbox/index.css +1 -0
- package/lib/components/communication/CommunicationRecord.js +22 -16
- package/lib/components/communication/index.css +50 -10
- package/lib/components/communication/index.js +86 -30
- package/lib/components/communication/style.js +8 -6
- package/lib/components/create-okr-modal/fields/o-new-name.js +31 -21
- package/lib/components/create-okr-modal/fields/okr-parent.js +1 -5
- package/lib/components/create-okr-modal/kr-items/krDatas.js +16 -16
- package/lib/components/{dynamic/components/dangerous-html → dangerous-html}/index.js +0 -0
- package/lib/components/dialog/index.css +4 -1
- package/lib/components/dialog/index.js +1 -1
- package/lib/components/dialog-confirm/index.css +1 -1
- package/lib/components/drawer-manager/index.js +6 -1
- package/lib/components/dynamic/components/first-level-tabs/index.css +12 -2
- package/lib/components/dynamic/components/first-level-tabs/index.js +19 -6
- package/lib/components/dynamic/components/obj-status/index.css +3 -19
- package/lib/components/dynamic/components/obj-status/index.js +7 -8
- package/lib/components/dynamic/components/obj-status/utils.js +37 -0
- package/lib/components/dynamic/components/percent/index.css +1 -1
- package/lib/components/dynamic/components/title/index.css +21 -22
- package/lib/components/dynamic/components/title/index.js +20 -8
- package/lib/components/dynamic/constant.js +12 -2
- package/lib/components/dynamic/dynamic-item/components/feed-operate/index.css +71 -0
- package/lib/components/dynamic/dynamic-item/components/feed-operate/index.js +112 -0
- package/lib/components/dynamic/dynamic-item/components/header/index.css +8 -7
- package/lib/components/dynamic/dynamic-item/components/header/index.js +13 -7
- package/lib/components/dynamic/dynamic-item/dynamic-align/img/dynamic-align-kr.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-align/img/dynamic-align-o.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-align/img/dynamic-align.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-align/index.css +44 -27
- package/lib/components/dynamic/dynamic-item/dynamic-align/index.js +43 -31
- package/lib/components/dynamic/dynamic-item/dynamic-announcement/index.css +5 -33
- package/lib/components/dynamic/dynamic-item/dynamic-announcement/index.js +6 -32
- package/lib/components/dynamic/dynamic-item/dynamic-assessment/index.css +58 -18
- package/lib/components/dynamic/dynamic-item/dynamic-assessment/index.js +31 -21
- package/lib/components/dynamic/dynamic-item/dynamic-chart/index.css +4 -0
- package/lib/components/dynamic/dynamic-item/dynamic-chart/index.js +102 -0
- package/lib/components/dynamic/dynamic-item/dynamic-chart/utils.js +61 -0
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.css +56 -44
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +52 -44
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.css +39 -27
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +25 -29
- package/lib/components/dynamic/dynamic-item/dynamic-learning/img/dynamic-share-course.png +0 -0
- package/lib/components/dynamic/dynamic-item/{dynamic-share-to-dynamic → dynamic-learning}/img/jiantou-right@3x.png +0 -0
- package/lib/components/dynamic/dynamic-item/{dynamic-share-to-dynamic → dynamic-learning}/img/user-photo.png +0 -0
- package/lib/components/dynamic/dynamic-item/{dynamic-share-to-dynamic → dynamic-learning}/index.css +10 -18
- package/lib/components/dynamic/dynamic-item/{dynamic-share-to-dynamic → dynamic-learning}/index.js +15 -30
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/constant.js +9 -2
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.css +31 -14
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +14 -25
- package/lib/components/dynamic/dynamic-item/dynamic-okrs-communication/index.css +25 -40
- package/lib/components/dynamic/dynamic-item/dynamic-okrs-communication/index.js +10 -29
- package/lib/components/dynamic/dynamic-item/dynamic-plan-communication/index.css +25 -40
- package/lib/components/dynamic/dynamic-item/dynamic-plan-communication/index.js +13 -30
- package/lib/components/dynamic/dynamic-item/dynamic-progress/index.css +13 -55
- package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +33 -80
- package/lib/components/dynamic/dynamic-item/dynamic-progress/utils.js +72 -0
- package/lib/components/dynamic/dynamic-item/dynamic-project/index.css +35 -28
- package/lib/components/dynamic/dynamic-item/dynamic-project/index.js +13 -24
- package/lib/components/dynamic/dynamic-item/dynamic-relative/img/dynamic-rela-kr.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-relative/img/dynamic-rela-o.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-relative/img/dynamic-rela-project.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-relative/img/dynamic-rela-task.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-relative/img/dynamic-rela.svg +23 -0
- package/lib/components/dynamic/dynamic-item/dynamic-relative/index.css +56 -31
- package/lib/components/dynamic/dynamic-item/dynamic-relative/index.js +78 -34
- package/lib/components/dynamic/dynamic-item/{dynamic-replay → dynamic-reply}/index.css +29 -32
- package/lib/components/dynamic/dynamic-item/{dynamic-replay → dynamic-reply}/index.js +12 -18
- package/lib/components/dynamic/dynamic-item/dynamic-report/index.css +20 -22
- package/lib/components/dynamic/dynamic-item/dynamic-report/index.js +42 -29
- package/lib/components/dynamic/dynamic-item/dynamic-reward/img/reward.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-reward/index.css +8 -3
- package/lib/components/dynamic/dynamic-item/dynamic-reward/index.js +23 -66
- package/lib/components/dynamic/dynamic-item/dynamic-reward/utils.js +28 -0
- package/lib/components/dynamic/dynamic-item/dynamic-share/index.css +8 -19
- package/lib/components/dynamic/dynamic-item/dynamic-share/index.js +59 -36
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.css +32 -28
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +11 -25
- package/lib/components/dynamic/dynamic-item/index.css +59 -4
- package/lib/components/dynamic/dynamic-item/index.js +148 -17
- package/lib/components/dynamic/dynamic-like-ranking/item.js +1 -1
- package/lib/components/dynamic/dynamic-list/index.js +2 -1
- package/lib/components/dynamic/dynamic-topping/item.js +8 -4
- package/lib/components/dynamic/dynamic.js +1 -1
- package/lib/components/dynamic/img/dynamic-operate.png +0 -0
- package/lib/components/dynamic/img/dynamic-point.svg +13 -0
- package/lib/components/dynamic/img/dynamic-reward-hover.svg +1 -0
- package/lib/components/dynamic/img/dynamic-reward-normal.svg +1 -0
- package/lib/components/dynamic/util.js +41 -81
- package/lib/components/e-status-dropdown/index.css +3 -0
- package/lib/components/e-status-dropdown/index.js +94 -0
- package/lib/components/file-list/components/single-file/index.css +14 -12
- package/lib/components/file-list/components/single-file/index.js +1 -1
- package/lib/components/file-list/index.css +1 -0
- package/lib/components/follower-visitor/index.js +6 -4
- package/lib/components/grid-layout/okr-progress/index.js +20 -30
- package/lib/components/help-card/image/not-try.png +0 -0
- package/lib/components/help-card/image/try.png +0 -0
- package/lib/components/help-card/index.css +31 -2
- package/lib/components/help-card/index.js +54 -17
- package/lib/components/invite-people/img/invite-people.svg +62 -0
- package/lib/components/invite-people/index.css +1 -1
- package/lib/components/mblog/context.js +3 -1
- package/lib/components/mblog/index.css +7 -0
- package/lib/components/mblog/index.js +45 -9
- package/lib/components/mblog/style.js +4 -4
- package/lib/components/menus/export-modules/demo-menus/index.js +2 -2
- package/lib/components/menus/export-modules/demo-menus/menu-highlight.js +25 -1
- package/lib/components/menus/export-modules/demo-menus/menus.js +60 -11
- package/lib/components/menus/export-modules/manage-menus/constant.js +1 -1
- package/lib/components/menus/export-modules/manage-menus/index.css +3 -0
- package/lib/components/menus/images/okr-gongsi.svg +17 -0
- package/lib/components/nav-top/components/menu/index.css +24 -0
- package/lib/components/nav-top/components/menu/index.js +9 -1
- package/lib/components/nav-top/components/user-message/components/reply/index.js +9 -8
- package/lib/components/nav-top/components/user-message/components/reply/reply-item.js +15 -5
- package/lib/components/nav-top/components/user-message/index.css +4 -3
- package/lib/components/nav-top/components/user-message/index.js +33 -6
- package/lib/components/nav-top/request.apis.js +8 -2
- package/lib/components/nav-top/useGlobalValue.js +14 -0
- package/lib/components/okr-detail/components/header/o-score.js +4 -6
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.css +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +27 -13
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-empty.js +7 -4
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-project.js +8 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-task.js +7 -3
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/index.css +20 -1
- package/lib/components/okr-detail/e-list/index.js +23 -7
- package/lib/components/okr-detail/e-list/util.js +7 -2
- package/lib/components/okr-detail/index.js +2 -0
- package/lib/components/okr-detail/okr-list/index.js +1 -5
- package/lib/components/okr-flow/export-modal/index.js +3 -3
- package/lib/components/okr-progress-detail/index.js +5 -1
- package/lib/components/okr-progress-modal/helper.js +20 -27
- package/lib/components/okr-share/common-painter/openDataPainter.js +34 -27
- package/lib/components/okrcase-library/okrcases-components/submitOkr-dialog.js +40 -36
- package/lib/components/open-data-painter/index.js +5 -1
- package/lib/components/progress/circle-progress/index.css +1 -0
- package/lib/components/progress/circle-progress/index.js +8 -3
- package/lib/components/rich-editor/basic/schema.js +47 -0
- package/lib/components/rich-editor/consts/events.js +12 -0
- package/lib/components/rich-editor/enums.js +42 -0
- package/lib/components/rich-editor/index.js +58 -0
- package/lib/components/rich-editor/keymap.js +119 -0
- package/lib/components/rich-editor/keymaps/index.js +241 -0
- package/lib/components/rich-editor/models/controller.js +18 -0
- package/lib/components/rich-editor/models/editor.js +47 -0
- package/lib/components/rich-editor/models/plugin.js +20 -0
- package/lib/components/rich-editor/models/schema.js +121 -0
- package/lib/components/rich-editor/plugins/block/block-quote/commond.js +27 -0
- package/lib/components/rich-editor/plugins/block/block-quote/index.js +128 -0
- package/lib/components/rich-editor/plugins/block/heading/commonds.js +31 -0
- package/lib/components/rich-editor/plugins/block/heading/index.js +190 -0
- package/lib/components/rich-editor/plugins/block/index.js +57 -0
- package/lib/components/rich-editor/plugins/block/lists/actions/conversions.js +172 -0
- package/lib/components/rich-editor/plugins/block/lists/actions/indent-list-items-selected.js +163 -0
- package/lib/components/rich-editor/plugins/block/lists/actions/indent-list.js +59 -0
- package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-forward.js +74 -0
- package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/index.js +45 -0
- package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +104 -0
- package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +92 -0
- package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +89 -0
- package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/join-paragraph-with-list.js +48 -0
- package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/join-sibling-list-items.js +61 -0
- package/lib/components/rich-editor/plugins/block/lists/actions/merge-lists.js +34 -0
- package/lib/components/rich-editor/plugins/block/lists/actions/outdent-list-items-selected.js +289 -0
- package/lib/components/rich-editor/plugins/block/lists/actions/wrap-and-join-lists.js +180 -0
- package/lib/components/rich-editor/plugins/block/lists/baseCommand.js +328 -0
- package/lib/components/rich-editor/plugins/block/lists/commond/indent-list.js +60 -0
- package/lib/components/rich-editor/plugins/block/lists/commond/index.js +396 -0
- package/lib/components/rich-editor/plugins/block/lists/commond/join-list-item-forward.js +45 -0
- package/lib/components/rich-editor/plugins/block/lists/commond/listBackspace.js +302 -0
- package/lib/components/rich-editor/plugins/block/lists/commond/outdent-list.js +43 -0
- package/lib/components/rich-editor/plugins/block/lists/index.js +224 -0
- package/lib/components/rich-editor/plugins/block/lists/messages.js +38 -0
- package/lib/components/rich-editor/plugins/block/lists/pm-plugins/input-rule.js +152 -0
- package/lib/components/rich-editor/plugins/block/lists/pm-plugins/keymap.js +33 -0
- package/lib/components/rich-editor/plugins/block/lists/pm-plugins/main.js +94 -0
- package/lib/components/rich-editor/plugins/block/lists/styles.js +15 -0
- package/lib/components/rich-editor/plugins/block/lists/transforms.js +347 -0
- package/lib/components/rich-editor/plugins/block/lists/utils/analytics.js +48 -0
- package/lib/components/rich-editor/plugins/block/lists/utils/find.js +126 -0
- package/lib/components/rich-editor/plugins/block/lists/utils/indentation.js +87 -0
- package/lib/components/rich-editor/plugins/block/lists/utils/node.js +144 -0
- package/lib/components/rich-editor/plugins/block/lists/utils/replace-content.js +31 -0
- package/lib/components/rich-editor/plugins/block/lists/utils/selection.js +201 -0
- package/lib/components/rich-editor/plugins/block/lists/utils.js +52 -0
- package/lib/components/rich-editor/plugins/block/paragraph/index.js +91 -0
- package/lib/components/rich-editor/plugins/core/index.js +90 -0
- package/lib/components/rich-editor/plugins/core/pm-plugins/focus-handler.js +67 -0
- package/lib/components/rich-editor/plugins/core/pm-plugins/keymap.js +29 -0
- package/lib/components/rich-editor/plugins/core/pm-plugins/reactNodeView.js +80 -0
- package/lib/components/rich-editor/plugins/extension/alignment/commond.js +24 -0
- package/lib/components/rich-editor/plugins/extension/alignment/index.js +113 -0
- package/lib/components/rich-editor/plugins/extension/alignment/utils.js +19 -0
- package/lib/components/rich-editor/plugins/extension/index.js +18 -0
- package/lib/components/rich-editor/plugins/extension/placeholder/index.js +126 -0
- package/lib/components/rich-editor/plugins/extension/placeholder/styles.js +19 -0
- package/lib/components/rich-editor/plugins/index.js +44 -0
- package/lib/components/rich-editor/plugins/inline/color/commond.js +128 -0
- package/lib/components/rich-editor/plugins/inline/color/consts.js +43 -0
- package/lib/components/rich-editor/plugins/inline/color/index.css +61 -0
- package/lib/components/rich-editor/plugins/inline/color/index.js +217 -0
- package/lib/components/rich-editor/plugins/inline/color/selector.js +252 -0
- package/lib/components/rich-editor/plugins/inline/color/util.js +25 -0
- package/lib/components/rich-editor/plugins/inline/delete-line/index.js +149 -0
- package/lib/components/rich-editor/plugins/inline/em/index.js +93 -0
- package/lib/components/rich-editor/plugins/inline/index.js +83 -0
- package/lib/components/rich-editor/plugins/inline/link/commands.js +256 -0
- package/lib/components/rich-editor/plugins/inline/link/index.js +149 -0
- package/lib/components/rich-editor/plugins/inline/link/pm-plugins/fake-cursor-for-toolbar.js +77 -0
- package/lib/components/rich-editor/plugins/inline/link/pm-plugins/main.js +293 -0
- package/lib/components/rich-editor/plugins/inline/link/ui/index.css +84 -0
- package/lib/components/rich-editor/plugins/inline/link/ui/linkEditor.js +150 -0
- package/lib/components/rich-editor/plugins/inline/link/ui/linkToolbar.js +101 -0
- package/lib/components/rich-editor/plugins/inline/link/ui/toolbarBtn.js +117 -0
- package/lib/components/rich-editor/plugins/inline/link/utils.js +33 -0
- package/lib/components/rich-editor/plugins/inline/strong/index.js +139 -0
- package/lib/components/rich-editor/plugins/inline/under-line/index.js +147 -0
- package/lib/components/rich-editor/plugins/util.js +284 -0
- package/lib/components/rich-editor/react/reactNodeView.js +383 -0
- package/lib/components/rich-editor/react/uiProvider.js +185 -0
- package/lib/components/rich-editor/schemas/basic.js +309 -0
- package/lib/components/rich-editor/schemas/index.js +19 -0
- package/lib/components/rich-editor/schemas/list.js +342 -0
- package/lib/components/rich-editor/types/commond.js +5 -0
- package/lib/components/rich-editor/types/index.js +18 -0
- package/lib/components/rich-editor/ui/Popup/index.js +247 -0
- package/lib/components/rich-editor/ui/Popup/utils.js +399 -0
- package/lib/components/rich-editor/ui/editor/index.css +178 -0
- package/lib/components/rich-editor/ui/editor/index.js +153 -0
- package/lib/components/rich-editor/ui/normal-toolbar/index.css +34 -0
- package/lib/components/rich-editor/ui/normal-toolbar/index.js +109 -0
- package/lib/components/rich-editor/utils/browser.js +35 -0
- package/lib/components/rich-editor/utils/commands.js +266 -0
- package/lib/components/rich-editor/utils/document.js +211 -0
- package/lib/components/rich-editor/utils/event.js +79 -0
- package/lib/components/rich-editor/utils/helpers.js +16 -0
- package/lib/components/rich-editor/utils/mark.js +168 -0
- package/lib/components/rich-editor/utils/slice.js +85 -0
- package/lib/components/rich-editor/utils/toolbar.js +228 -0
- package/lib/components/search-key-handle/index.js +7 -2
- package/lib/components/superset-charts/components/chart/index.js +54 -0
- package/lib/components/superset-charts/fetch-assets-and-append/append-assets.js +106 -0
- package/lib/components/superset-charts/fetch-assets-and-append/get-assets-with-cache.js +131 -0
- package/lib/components/superset-charts/fetch-assets-and-append/index.js +79 -0
- package/lib/components/superset-charts/index.js +13 -0
- package/lib/components/superset-charts/interface.js +5 -0
- package/lib/components/superset-charts/utils/axios.js +94 -0
- package/lib/components/toast/index.js +5 -17
- package/lib/components/upload/index.js +4 -2
- package/lib/components/upload/util.js +2 -0
- package/lib/components/user-selector/empty/index.css +6 -6
- package/lib/components/user-selector/selected-panel/index.css +3 -3
- package/lib/components/video-modal/components/video-box/index.css +240 -0
- package/lib/components/video-modal/components/video-box/index.js +334 -0
- package/lib/components/video-modal/img/bigFaqi.png +0 -0
- package/lib/components/video-modal/img/close.png +0 -0
- package/lib/components/video-modal/img/full.svg +21 -0
- package/lib/components/video-modal/img/muted.svg +14 -0
- package/lib/components/video-modal/img/not-muted.svg +22 -0
- package/lib/components/video-modal/img/pause.svg +13 -0
- package/lib/components/video-modal/img/play.svg +18 -0
- package/lib/components/video-modal/img/small.svg +22 -0
- package/lib/components/video-modal/index.css +83 -0
- package/lib/components/video-modal/index.js +182 -0
- package/lib/components/video-modal/utils.js +25 -0
- package/lib/components/weekly-report/common-painter/openDataPainter.js +5 -1
- package/lib/hooks/useGlobalState.js +63 -0
- package/lib/index.js +40 -0
- package/lib/pages/aha2021/img/canceled.svg +13 -0
- package/lib/pages/aha2021/img/not-try.png +0 -0
- package/lib/pages/aha2021/img/try.png +0 -0
- package/lib/pages/aha2021/index.css +52 -0
- package/lib/pages/aha2021/index.js +73 -14
- package/lib/pages/new-okr-list/header/index.js +2 -1
- package/lib/pages/new-okr-list/index.js +3 -3
- package/lib/pages/okr-map/export-modules/share-okr-page/header/index.js +0 -5
- package/lib/pages/pay/image/success.png +0 -0
- package/lib/pages/pay/index.css +79 -0
- package/lib/pages/pay/index.js +66 -0
- package/lib/utils/bs-global.js +13 -9
- package/lib/utils/helpers.js +7 -1
- package/lib/utils/open-data.js +2 -1
- package/lib/utils/tools.js +11 -2
- package/package.json +120 -101
- package/lib/components/dynamic/dynamic-item/dynamic-align/img/dynamic-align.svg +0 -22
- package/lib/components/dynamic/dynamic-item/dynamic-align/img/dynamic-relative.svg +0 -22
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/img/dynamic-milestone.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-okrs-communication/img/okrs-icon.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-plan-communication/img/plan-icon.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-project/img/dynamic-project.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-relative/img/dynamic-relative.svg +0 -22
- package/lib/components/dynamic/dynamic-item/dynamic-share-to-dynamic/img/guanlian.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-icon.png +0 -0
- package/lib/components/invite-people/img/invite-people.png +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.placeholderStyles = exports.placeHolderClassName = void 0;
|
|
7
|
+
|
|
8
|
+
var _styledComponents = require("styled-components");
|
|
9
|
+
|
|
10
|
+
var _colors = require("@atlaskit/theme/colors");
|
|
11
|
+
|
|
12
|
+
var _templateObject;
|
|
13
|
+
|
|
14
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
15
|
+
|
|
16
|
+
var placeHolderClassName = 'placeholder-decoration';
|
|
17
|
+
exports.placeHolderClassName = placeHolderClassName;
|
|
18
|
+
var placeholderStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror .", " {\n position: relative;\n color: ", ";\n width: 100%;\n\n pointer-events: none;\n display: block;\n user-select: none;\n\n > span {\n position: absolute;\n pointer-events: none;\n }\n\n &.align-end > span {\n right: 0;\n }\n\n &.align-center > span {\n left: 0;\n }\n }\n"])), placeHolderClassName, _colors.N200);
|
|
19
|
+
exports.placeholderStyles = placeholderStyles;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _block = require("./block");
|
|
8
|
+
|
|
9
|
+
Object.keys(_block).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _block[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _block[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
var _inline = require("./inline");
|
|
21
|
+
|
|
22
|
+
Object.keys(_inline).forEach(function (key) {
|
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
|
24
|
+
if (key in exports && exports[key] === _inline[key]) return;
|
|
25
|
+
Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function get() {
|
|
28
|
+
return _inline[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
var _extension = require("./extension");
|
|
34
|
+
|
|
35
|
+
Object.keys(_extension).forEach(function (key) {
|
|
36
|
+
if (key === "default" || key === "__esModule") return;
|
|
37
|
+
if (key in exports && exports[key] === _extension[key]) return;
|
|
38
|
+
Object.defineProperty(exports, key, {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function get() {
|
|
41
|
+
return _extension[key];
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.setColor = setColor;
|
|
7
|
+
exports.toggleMark = toggleMark;
|
|
8
|
+
|
|
9
|
+
var _util = require("../../util");
|
|
10
|
+
|
|
11
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
12
|
+
|
|
13
|
+
function setColor(editor, type, color) {
|
|
14
|
+
var state = editor.state; //@ts-ignore
|
|
15
|
+
|
|
16
|
+
var _state$selection = state.selection,
|
|
17
|
+
empty = _state$selection.empty,
|
|
18
|
+
$cursor = _state$selection.$cursor,
|
|
19
|
+
ranges = _state$selection.ranges,
|
|
20
|
+
from = _state$selection.from,
|
|
21
|
+
to = _state$selection.to;
|
|
22
|
+
if (empty && !$cursor || !markApplies(state.doc, ranges, type)) return false;
|
|
23
|
+
|
|
24
|
+
if ($cursor) {
|
|
25
|
+
if (type.isInSet(state.storedMarks || $cursor.marks() || !color)) editor.view.dispatch(state.tr.removeStoredMark(type));else editor.view.dispatch(state.tr.addStoredMark(type.create({
|
|
26
|
+
color: color
|
|
27
|
+
})));
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
var tr = state.tr;
|
|
32
|
+
|
|
33
|
+
if (!color) {
|
|
34
|
+
tr.removeMark(state.selection.from, state.selection.to, type);
|
|
35
|
+
} else {
|
|
36
|
+
var isShared = (0, _util.isSharedMark)(editor, from, to, type, {
|
|
37
|
+
color: color
|
|
38
|
+
});
|
|
39
|
+
tr.removeMark(state.selection.from, state.selection.to, type);
|
|
40
|
+
if (!isShared) tr.addMark(from, to, type.create({
|
|
41
|
+
color: color
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
editor.view.dispatch(tr.scrollIntoView());
|
|
46
|
+
editor.view.focus();
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function markApplies(doc, ranges, type) {
|
|
51
|
+
var _loop = function _loop(i) {
|
|
52
|
+
var _ranges$i = ranges[i],
|
|
53
|
+
$from = _ranges$i.$from,
|
|
54
|
+
$to = _ranges$i.$to;
|
|
55
|
+
var can = $from.depth == 0 ? doc.type.allowsMarkType(type) : false;
|
|
56
|
+
doc.nodesBetween($from.pos, $to.pos, function (node) {
|
|
57
|
+
if (can) return false;
|
|
58
|
+
can = node.inlineContent && node.type.allowsMarkType(type);
|
|
59
|
+
});
|
|
60
|
+
if (can) return {
|
|
61
|
+
v: true
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
for (var i = 0; i < ranges.length; i++) {
|
|
66
|
+
var _ret = _loop(i);
|
|
67
|
+
|
|
68
|
+
if (_typeof(_ret) === "object") return _ret.v;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function toggleMark(markType, attrs) {
|
|
75
|
+
return function (state, dispatch) {
|
|
76
|
+
var _state$selection2 = state.selection,
|
|
77
|
+
empty = _state$selection2.empty,
|
|
78
|
+
$cursor = _state$selection2.$cursor,
|
|
79
|
+
ranges = _state$selection2.ranges;
|
|
80
|
+
if (empty && !$cursor || !markApplies(state.doc, ranges, markType)) return false;
|
|
81
|
+
|
|
82
|
+
if (dispatch) {
|
|
83
|
+
if ($cursor) {
|
|
84
|
+
if (markType.isInSet(state.storedMarks || $cursor.marks())) dispatch(state.tr.removeStoredMark(markType));else dispatch(state.tr.addStoredMark(markType.create(attrs)));
|
|
85
|
+
} else {
|
|
86
|
+
var has = false,
|
|
87
|
+
tr = state.tr;
|
|
88
|
+
|
|
89
|
+
for (var i = 0; !has && i < ranges.length; i++) {
|
|
90
|
+
var _ranges$i2 = ranges[i],
|
|
91
|
+
$from = _ranges$i2.$from,
|
|
92
|
+
$to = _ranges$i2.$to;
|
|
93
|
+
has = state.doc.rangeHasMark($from.pos, $to.pos, markType);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
for (var _i = 0; _i < ranges.length; _i++) {
|
|
97
|
+
var _ranges$_i = ranges[_i],
|
|
98
|
+
_$from = _ranges$_i.$from,
|
|
99
|
+
_$to = _ranges$_i.$to;
|
|
100
|
+
|
|
101
|
+
if (has) {
|
|
102
|
+
tr.removeMark(_$from.pos, _$to.pos, markType);
|
|
103
|
+
} else {
|
|
104
|
+
var _$exec, _$exec2;
|
|
105
|
+
|
|
106
|
+
var from = _$from.pos,
|
|
107
|
+
to = _$to.pos,
|
|
108
|
+
start = _$from.nodeAfter,
|
|
109
|
+
end = _$to.nodeBefore;
|
|
110
|
+
var spaceStart = start && start.isText ? ((_$exec = /^\s*/.exec(start.text)) === null || _$exec === void 0 ? void 0 : _$exec[0].length) || 0 : 0;
|
|
111
|
+
var spaceEnd = end && end.isText ? ((_$exec2 = /\s*$/.exec(end.text)) === null || _$exec2 === void 0 ? void 0 : _$exec2[0].length) || 0 : 0;
|
|
112
|
+
|
|
113
|
+
if (from + spaceStart < to) {
|
|
114
|
+
from += spaceStart;
|
|
115
|
+
to -= spaceEnd;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
tr.addMark(from, to, markType.create(attrs));
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
dispatch(tr.scrollIntoView());
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return true;
|
|
127
|
+
};
|
|
128
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FontColor = exports.BackgroundColor = void 0;
|
|
7
|
+
var FontColor;
|
|
8
|
+
exports.FontColor = FontColor;
|
|
9
|
+
|
|
10
|
+
(function (FontColor) {
|
|
11
|
+
FontColor["default"] = "#141C28";
|
|
12
|
+
FontColor["black1"] = "#3F4755";
|
|
13
|
+
FontColor["black2"] = "#6F7886";
|
|
14
|
+
FontColor["black3"] = "#A4ACB9";
|
|
15
|
+
FontColor["red1"] = "#F02673";
|
|
16
|
+
FontColor["red2"] = "#F05E5E";
|
|
17
|
+
FontColor["yellow1"] = "#F0A326";
|
|
18
|
+
FontColor["yellow2"] = "#F6BD16";
|
|
19
|
+
FontColor["green1"] = "#5AD8A6";
|
|
20
|
+
FontColor["green2"] = "#26D8F0";
|
|
21
|
+
FontColor["blue1"] = "#3D26F0";
|
|
22
|
+
FontColor["blue2"] = "#2879FF";
|
|
23
|
+
FontColor["purple1"] = "#A226F0";
|
|
24
|
+
})(FontColor || (exports.FontColor = FontColor = {}));
|
|
25
|
+
|
|
26
|
+
var BackgroundColor;
|
|
27
|
+
exports.BackgroundColor = BackgroundColor;
|
|
28
|
+
|
|
29
|
+
(function (BackgroundColor) {
|
|
30
|
+
BackgroundColor["default"] = "transparent";
|
|
31
|
+
BackgroundColor["red2"] = "rgba(240, 94, 94, 0.2)";
|
|
32
|
+
BackgroundColor["yellow2"] = "rgba(246, 189, 22, 0.2)";
|
|
33
|
+
BackgroundColor["grenn2"] = "rgba(90, 216, 166, 0.2)";
|
|
34
|
+
BackgroundColor["blue2"] = "rgba(40, 121, 255, 0.2)";
|
|
35
|
+
BackgroundColor["purple2"] = "rgba(162, 38, 240, 0.2)";
|
|
36
|
+
BackgroundColor["gray2"] = "rgba(191, 199, 213, 0.2)";
|
|
37
|
+
BackgroundColor["red1"] = "rgba(240, 94, 94, 0.6)";
|
|
38
|
+
BackgroundColor["yellow1"] = "rgba(246, 189, 22, 0.6)";
|
|
39
|
+
BackgroundColor["green1"] = "rgba(90, 216, 166, 0.6)";
|
|
40
|
+
BackgroundColor["blue1"] = "rgba(40, 121, 255, 0.6)";
|
|
41
|
+
BackgroundColor["purple1"] = "rgba(162, 38, 240, 0.6)";
|
|
42
|
+
BackgroundColor["gray1"] = "rgba(191, 199, 213, 0.6)";
|
|
43
|
+
})(BackgroundColor || (exports.BackgroundColor = BackgroundColor = {}));
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
.tita-rich-editor-color-selector {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
padding: 12px 21px 0;
|
|
6
|
+
width: 234px;
|
|
7
|
+
height: 208px;
|
|
8
|
+
background: #ffffff;
|
|
9
|
+
box-shadow: 0px 4px 12px 0px rgba(127, 145, 180, 0.2);
|
|
10
|
+
border-radius: 12px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.tita-rich-editor-color-selector__icon {
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.tita-rich-editor-color-selector__title {
|
|
22
|
+
font-size: 12px;
|
|
23
|
+
font-weight: 400;
|
|
24
|
+
color: #6f7886;
|
|
25
|
+
line-height: 18px;
|
|
26
|
+
padding-left: 3px;
|
|
27
|
+
margin-bottom: 4px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.tita-rich-editor-color-selector__color-box {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-wrap: wrap;
|
|
33
|
+
justify-content: space-between;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.tita-rich-editor-color-selector__color-box > div {
|
|
37
|
+
border: 1px solid #e9ecf0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.tita-rich-editor-color-selector__item {
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
box-sizing: border-box;
|
|
45
|
+
width: 26px;
|
|
46
|
+
height: 26px;
|
|
47
|
+
border-radius: 4px;
|
|
48
|
+
margin: 3px;
|
|
49
|
+
color: #3f4755;
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.tita-rich-editor-color-selector__item:hover {
|
|
54
|
+
border: 1px solid rgba(40, 121, 255, 0.3);
|
|
55
|
+
box-shadow: 0 0 0 1px #fff inset;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.tita-rich-editor-color-selector__item--active {
|
|
59
|
+
border: 1px solid #2879ff !important;
|
|
60
|
+
box-shadow: 0 0 0 1px #fff inset;
|
|
61
|
+
}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.FontColorSchema = exports.FONT_COLOR_SCHEMA_NAME = exports.ColorPlugin = exports.ColorController = exports.BackgroundColorSchema = exports.BACKGROUND_COLOR_SCHEMA_NAME = void 0;
|
|
9
|
+
|
|
10
|
+
var _plugin = _interopRequireDefault(require("../../../models/plugin"));
|
|
11
|
+
|
|
12
|
+
var _schema = require("../../../models/schema");
|
|
13
|
+
|
|
14
|
+
var _controller = _interopRequireDefault(require("../../../models/controller"));
|
|
15
|
+
|
|
16
|
+
var _prosemirrorCommands = require("prosemirror-commands");
|
|
17
|
+
|
|
18
|
+
var _selector = _interopRequireDefault(require("./selector"));
|
|
19
|
+
|
|
20
|
+
var _getLocale = require("../../../../../utils/getLocale");
|
|
21
|
+
|
|
22
|
+
var _util = require("./util");
|
|
23
|
+
|
|
24
|
+
var _consts = require("./consts");
|
|
25
|
+
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
|
+
|
|
28
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
29
|
+
|
|
30
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
31
|
+
|
|
32
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
33
|
+
|
|
34
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
35
|
+
|
|
36
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
37
|
+
|
|
38
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
39
|
+
|
|
40
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
41
|
+
|
|
42
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
43
|
+
|
|
44
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
45
|
+
|
|
46
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
47
|
+
|
|
48
|
+
var PLUGIN_NAME = 'color';
|
|
49
|
+
var FONT_COLOR_SCHEMA_NAME = 'fontColor';
|
|
50
|
+
exports.FONT_COLOR_SCHEMA_NAME = FONT_COLOR_SCHEMA_NAME;
|
|
51
|
+
var BACKGROUND_COLOR_SCHEMA_NAME = 'backgroundColor';
|
|
52
|
+
exports.BACKGROUND_COLOR_SCHEMA_NAME = BACKGROUND_COLOR_SCHEMA_NAME;
|
|
53
|
+
var colorReg = /^\s*(rgba\([^)]+\)|rgb\([^)]+\)|#[\d|a-f]{3,6})|\w*/i;
|
|
54
|
+
|
|
55
|
+
var getColorAttrs = function getColorAttrs(style) {
|
|
56
|
+
var color = style;
|
|
57
|
+
var key = (0, _util.findColor)(color, _consts.FontColor);
|
|
58
|
+
|
|
59
|
+
if (key) {
|
|
60
|
+
return {
|
|
61
|
+
color: _consts.FontColor[key]
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return false;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
var FontColorSchema = /*#__PURE__*/function (_InlineSchema) {
|
|
69
|
+
_inherits(FontColorSchema, _InlineSchema);
|
|
70
|
+
|
|
71
|
+
var _super = _createSuper(FontColorSchema);
|
|
72
|
+
|
|
73
|
+
function FontColorSchema() {
|
|
74
|
+
var _this;
|
|
75
|
+
|
|
76
|
+
_classCallCheck(this, FontColorSchema);
|
|
77
|
+
|
|
78
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
79
|
+
args[_key] = arguments[_key];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.name = FONT_COLOR_SCHEMA_NAME, _this.attrs = {
|
|
83
|
+
color: {
|
|
84
|
+
"default": ''
|
|
85
|
+
}
|
|
86
|
+
}, _this.parseDOM = [{
|
|
87
|
+
style: 'color',
|
|
88
|
+
getAttrs: getColorAttrs
|
|
89
|
+
}, {
|
|
90
|
+
tag: '*[color]',
|
|
91
|
+
getAttrs: function getAttrs(dom) {
|
|
92
|
+
return getColorAttrs(dom.getAttribute('color'));
|
|
93
|
+
}
|
|
94
|
+
}], _assertThisInitialized(_this)));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
_createClass(FontColorSchema, [{
|
|
98
|
+
key: "toDOM",
|
|
99
|
+
value: function toDOM(node) {
|
|
100
|
+
return ["span", {
|
|
101
|
+
style: "color:".concat(node.attrs.color || '')
|
|
102
|
+
}, 0];
|
|
103
|
+
}
|
|
104
|
+
}]);
|
|
105
|
+
|
|
106
|
+
return FontColorSchema;
|
|
107
|
+
}(_schema.InlineSchema);
|
|
108
|
+
|
|
109
|
+
exports.FontColorSchema = FontColorSchema;
|
|
110
|
+
|
|
111
|
+
var getBgAttrs = function getBgAttrs(style) {
|
|
112
|
+
var colorMatch = style.match(colorReg);
|
|
113
|
+
if (!colorMatch) return false;
|
|
114
|
+
var background = colorMatch[0];
|
|
115
|
+
var key = (0, _util.findColor)(background, _consts.BackgroundColor);
|
|
116
|
+
|
|
117
|
+
if (key) {
|
|
118
|
+
return {
|
|
119
|
+
color: _consts.BackgroundColor[key]
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return false;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
var BackgroundColorSchema = /*#__PURE__*/function (_InlineSchema2) {
|
|
127
|
+
_inherits(BackgroundColorSchema, _InlineSchema2);
|
|
128
|
+
|
|
129
|
+
var _super2 = _createSuper(BackgroundColorSchema);
|
|
130
|
+
|
|
131
|
+
function BackgroundColorSchema() {
|
|
132
|
+
var _this2;
|
|
133
|
+
|
|
134
|
+
_classCallCheck(this, BackgroundColorSchema);
|
|
135
|
+
|
|
136
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
137
|
+
args[_key2] = arguments[_key2];
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return _possibleConstructorReturn(_this2, (_this2 = _super2.call.apply(_super2, [this].concat(args)), _this2.name = BACKGROUND_COLOR_SCHEMA_NAME, _this2.attrs = {
|
|
141
|
+
color: {
|
|
142
|
+
"default": ''
|
|
143
|
+
}
|
|
144
|
+
}, _this2.parseDOM = [{
|
|
145
|
+
style: 'background',
|
|
146
|
+
getAttrs: getBgAttrs
|
|
147
|
+
}, {
|
|
148
|
+
style: 'background-color',
|
|
149
|
+
getAttrs: getBgAttrs
|
|
150
|
+
}], _assertThisInitialized(_this2)));
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
_createClass(BackgroundColorSchema, [{
|
|
154
|
+
key: "toDOM",
|
|
155
|
+
value: function toDOM(node) {
|
|
156
|
+
return ["span", {
|
|
157
|
+
style: "background-color:".concat(node.attrs.color || '')
|
|
158
|
+
}, 0];
|
|
159
|
+
}
|
|
160
|
+
}]);
|
|
161
|
+
|
|
162
|
+
return BackgroundColorSchema;
|
|
163
|
+
}(_schema.InlineSchema);
|
|
164
|
+
|
|
165
|
+
exports.BackgroundColorSchema = BackgroundColorSchema;
|
|
166
|
+
|
|
167
|
+
var ColorController = /*#__PURE__*/function (_BaseController) {
|
|
168
|
+
_inherits(ColorController, _BaseController);
|
|
169
|
+
|
|
170
|
+
var _super3 = _createSuper(ColorController);
|
|
171
|
+
|
|
172
|
+
function ColorController() {
|
|
173
|
+
var _this3;
|
|
174
|
+
|
|
175
|
+
_classCallCheck(this, ColorController);
|
|
176
|
+
|
|
177
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
178
|
+
args[_key3] = arguments[_key3];
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
return _possibleConstructorReturn(_this3, (_this3 = _super3.call.apply(_super3, [this].concat(args)), _this3.toolbar = {
|
|
182
|
+
title: (0, _getLocale.getLocale)('Tasks_Tab_MyS_Textcolor'),
|
|
183
|
+
icon: 'tu-icon-text-color',
|
|
184
|
+
handler: function handler(editor) {
|
|
185
|
+
(0, _prosemirrorCommands.toggleMark)(editor.state.schema.marks[PLUGIN_NAME])(editor.state, editor.view.dispatch);
|
|
186
|
+
editor.view.focus();
|
|
187
|
+
},
|
|
188
|
+
renderMenu: _selector["default"]
|
|
189
|
+
}, _assertThisInitialized(_this3)));
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
return _createClass(ColorController);
|
|
193
|
+
}(_controller["default"]);
|
|
194
|
+
|
|
195
|
+
exports.ColorController = ColorController;
|
|
196
|
+
|
|
197
|
+
var ColorPlugin = /*#__PURE__*/function (_BasePlugin) {
|
|
198
|
+
_inherits(ColorPlugin, _BasePlugin);
|
|
199
|
+
|
|
200
|
+
var _super4 = _createSuper(ColorPlugin);
|
|
201
|
+
|
|
202
|
+
function ColorPlugin() {
|
|
203
|
+
var _this4;
|
|
204
|
+
|
|
205
|
+
_classCallCheck(this, ColorPlugin);
|
|
206
|
+
|
|
207
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
208
|
+
args[_key4] = arguments[_key4];
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return _possibleConstructorReturn(_this4, (_this4 = _super4.call.apply(_super4, [this].concat(args)), _this4.name = PLUGIN_NAME, _this4.schema = [FontColorSchema, BackgroundColorSchema], _this4.controller = ColorController, _assertThisInitialized(_this4)));
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
return _createClass(ColorPlugin);
|
|
215
|
+
}(_plugin["default"]);
|
|
216
|
+
|
|
217
|
+
exports.ColorPlugin = ColorPlugin;
|