@titaui/pc 1.10.7 → 1.10.8-2.beta-1
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 +4 -4
- 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 +3 -2
- package/lib/components/checkbox/index.css +1 -0
- package/lib/components/communication/CommunicationRecord.js +16 -16
- package/lib/components/communication/index.css +16 -15
- package/lib/components/communication/index.js +23 -6
- package/lib/components/communication/style.js +4 -4
- 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/index.js +3 -2
- 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 +1 -0
- package/lib/components/dynamic/components/obj-status/utils.js +1 -1
- 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 +2 -1
- package/lib/components/dynamic/dynamic-item/components/header/index.js +2 -2
- package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/index.js +27 -0
- package/lib/components/dynamic/dynamic-item/dynamic-align/index.css +13 -7
- package/lib/components/dynamic/dynamic-item/dynamic-align/index.js +10 -4
- package/lib/components/dynamic/dynamic-item/dynamic-announcement/index.css +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-assessment/index.css +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-assessment/index.js +5 -3
- 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 +12 -11
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +8 -5
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.css +2 -2
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +5 -3
- package/lib/components/dynamic/dynamic-item/{dynamic-share-to-dynamic → 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 +2 -2
- package/lib/components/dynamic/dynamic-item/{dynamic-share-to-dynamic → dynamic-learning}/index.js +6 -5
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/constant.js +9 -2
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.css +2 -2
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +4 -2
- package/lib/components/dynamic/dynamic-item/dynamic-okrs-communication/index.css +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-plan-communication/index.css +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-progress/index.css +2 -6
- package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +4 -2
- package/lib/components/dynamic/dynamic-item/dynamic-project/index.css +2 -2
- package/lib/components/dynamic/dynamic-item/dynamic-project/index.js +3 -1
- package/lib/components/dynamic/dynamic-item/dynamic-relative/index.css +13 -7
- package/lib/components/dynamic/dynamic-item/dynamic-relative/index.js +42 -6
- package/lib/components/dynamic/dynamic-item/{dynamic-replay → dynamic-reply}/index.css +14 -30
- package/lib/components/dynamic/dynamic-item/{dynamic-replay → dynamic-reply}/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-report/index.css +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-report/index.js +12 -3
- package/lib/components/dynamic/dynamic-item/dynamic-reward/img/reward.png +0 -0
- package/lib/components/dynamic/dynamic-item/dynamic-reward/index.css +6 -1
- package/lib/components/dynamic/dynamic-item/dynamic-reward/index.js +18 -51
- package/lib/components/dynamic/dynamic-item/dynamic-reward/utils.js +28 -0
- package/lib/components/dynamic/dynamic-item/dynamic-share/index.css +6 -2
- package/lib/components/dynamic/dynamic-item/dynamic-share/index.js +55 -2
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.css +2 -2
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/index.css +58 -3
- package/lib/components/dynamic/dynamic-item/index.js +124 -23
- package/lib/components/dynamic/dynamic-like-ranking/item.js +1 -1
- package/lib/components/dynamic/dynamic-list/index.js +11 -2
- package/lib/components/dynamic/dynamic-topping/item.js +8 -4
- package/lib/components/dynamic/dynamic.js +5 -2
- 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/online-broadcast/data.js +13 -1
- package/lib/components/e-status-dropdown/index.css +3 -0
- package/lib/components/e-status-dropdown/index.js +94 -0
- package/lib/components/edit-kr-wight/style/index.js +2 -2
- package/lib/components/file-list/components/single-file/index.css +6 -5
- 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/index.js +14 -5
- 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/export-modules/okr-menus/subordinate-menus/index.js +34 -12
- 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 +22 -8
- package/lib/components/nav-top/useGlobalValue.js +14 -0
- package/lib/components/okr-detail/components/header/o-name.js +11 -4
- 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 +26 -12
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +11 -5
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-project.js +20 -7
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-task-level2.js +3 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-task.js +27 -6
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/index.css +29 -10
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +1 -1
- package/lib/components/okr-detail/detail-header/actions.js +40 -44
- package/lib/components/okr-detail/detail-header/index.css +2 -2
- package/lib/components/okr-detail/detail-header/index.js +207 -195
- package/lib/components/okr-detail/e-list/index.js +70 -24
- package/lib/components/okr-detail/e-list/util.js +11 -2
- package/lib/components/okr-detail/index.js +4 -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-flow/root-node/index.js +14 -1
- package/lib/components/okr-progress-detail/index.css +11 -10
- package/lib/components/okr-progress-detail/index.js +5 -1
- package/lib/components/okr-progress-detail/utils.js +4 -4
- 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.js +1 -1
- 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/scrollbar/index.js +67 -9
- package/lib/components/scrollbar/scroll-mask/index.css +29 -0
- package/lib/components/scrollbar/scroll-mask/index.js +152 -0
- 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 +142 -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 +102 -0
- package/lib/components/toast/index.js +5 -17
- package/lib/components/tree/index.css +3 -2
- package/lib/components/upload/index.js +4 -2
- package/lib/components/upload/util.js +2 -0
- package/lib/components/upload-photo-modal/request-api.js +1 -17
- package/lib/components/user-selector/empty/index.css +6 -6
- package/lib/components/user-selector/selected-panel/index.css +3 -3
- package/lib/components/{float-fixed-video-modal → video-modal/components/video-box}/index.css +118 -121
- package/lib/components/{float-fixed-video-modal → video-modal/components/video-box}/index.js +182 -182
- package/lib/components/{float-fixed-video-modal → video-modal}/img/close.png +0 -0
- package/lib/components/{float-fixed-video-modal → video-modal}/img/full.svg +0 -0
- package/lib/components/video-modal/img/muted.svg +8 -10
- package/lib/components/video-modal/img/not-muted.svg +17 -11
- package/lib/components/video-modal/img/pause.svg +7 -11
- package/lib/components/video-modal/img/play.svg +13 -11
- package/lib/components/video-modal/index.css +38 -168
- package/lib/components/video-modal/index.js +104 -244
- package/lib/components/video-modal/utils.js +2 -2
- package/lib/components/wechat-btn/index.css +10 -0
- package/lib/components/wechat-btn/index.js +232 -0
- package/lib/components/weekly-report/common-painter/openDataPainter.js +5 -1
- package/lib/hooks/useGlobalState.js +63 -0
- package/lib/index.js +39 -7
- 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/group-management/tree/group-form/index.js +1 -1
- package/lib/pages/new-okr-list/header/index.js +2 -1
- package/lib/pages/new-okr-list/index.js +10 -13
- 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/pages/personal-info/request-api.js +1 -1
- package/lib/utils/auth.js +15 -5
- package/lib/utils/bs-global.js +8 -8
- package/lib/utils/helpers.js +7 -1
- package/lib/utils/open-data.js +82 -2
- package/package.json +121 -101
- package/lib/components/float-fixed-video-modal/img/muted.svg +0 -21
- package/lib/components/float-fixed-video-modal/img/pause.svg +0 -21
- package/lib/components/float-fixed-video-modal/img/play.svg +0 -22
- package/lib/components/float-fixed-video-modal/img/small.svg +0 -22
- package/lib/components/float-fixed-video-modal/img/smallFaQi.png +0 -0
- package/lib/components/float-fixed-video-modal/img/volume.svg +0 -21
- package/lib/components/float-fixed-video-modal/utils.js +0 -25
- package/lib/components/invite-people/img/invite-people.png +0 -0
- package/lib/components/video-modal/img/play.png +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TOOLBAR_MOUSE_DOWN = exports.EDITOR_STATE_CHANGE = exports.EDITOR_MOUSE_DOWN = void 0;
|
|
7
|
+
var TOOLBAR_MOUSE_DOWN = 'tool_bar_mouse_down';
|
|
8
|
+
exports.TOOLBAR_MOUSE_DOWN = TOOLBAR_MOUSE_DOWN;
|
|
9
|
+
var EDITOR_MOUSE_DOWN = 'editor_mouse_down';
|
|
10
|
+
exports.EDITOR_MOUSE_DOWN = EDITOR_MOUSE_DOWN;
|
|
11
|
+
var EDITOR_STATE_CHANGE = 'editor_state_change';
|
|
12
|
+
exports.EDITOR_STATE_CHANGE = EDITOR_STATE_CHANGE;
|
|
@@ -0,0 +1,42 @@
|
|
|
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["black1"] = "#141C28";
|
|
12
|
+
FontColor["black2"] = "#3F4755";
|
|
13
|
+
FontColor["black3"] = "#6F7886";
|
|
14
|
+
FontColor["red1"] = "#F02673";
|
|
15
|
+
FontColor["red2"] = "#F05E5E";
|
|
16
|
+
FontColor["yellow1"] = "#F0A326";
|
|
17
|
+
FontColor["yellow2"] = "#F6BD16";
|
|
18
|
+
FontColor["green1"] = "#5AD8A6";
|
|
19
|
+
FontColor["green2"] = "#26D8F0";
|
|
20
|
+
FontColor["blue1"] = "#3D26F0";
|
|
21
|
+
FontColor["blue2"] = "#2879FF";
|
|
22
|
+
FontColor["purple1"] = "#A226F0";
|
|
23
|
+
})(FontColor || (exports.FontColor = FontColor = {}));
|
|
24
|
+
|
|
25
|
+
var BackgroundColor;
|
|
26
|
+
exports.BackgroundColor = BackgroundColor;
|
|
27
|
+
|
|
28
|
+
(function (BackgroundColor) {
|
|
29
|
+
BackgroundColor["transparent"] = "transparent";
|
|
30
|
+
BackgroundColor["red1"] = "rgba(240, 94, 94, 0.6)";
|
|
31
|
+
BackgroundColor["red2"] = "rgba(240, 94, 94, 0.2)";
|
|
32
|
+
BackgroundColor["yellow1"] = "rgba(246, 189, 22, 0.6)";
|
|
33
|
+
BackgroundColor["yellow2"] = "rgba(246, 189, 22, 0.2)";
|
|
34
|
+
BackgroundColor["green1"] = "rgba(90, 216, 166, 0.6)";
|
|
35
|
+
BackgroundColor["grenn2"] = "rgba(90, 216, 166, 0.2)";
|
|
36
|
+
BackgroundColor["blue1"] = "rgba(40, 121, 255, 0.6)";
|
|
37
|
+
BackgroundColor["blue2"] = "rgba(40, 121, 255, 0.2)";
|
|
38
|
+
BackgroundColor["purple1"] = "rgba(162, 38, 240, 0.6)";
|
|
39
|
+
BackgroundColor["purple2"] = "rgba(162, 38, 240, 0.2)";
|
|
40
|
+
BackgroundColor["gray1"] = "rgba(191, 199, 213, 0.6)";
|
|
41
|
+
BackgroundColor["gray2"] = "rgba(191, 199, 213, 0.2)";
|
|
42
|
+
})(BackgroundColor || (exports.BackgroundColor = BackgroundColor = {}));
|
|
@@ -0,0 +1,58 @@
|
|
|
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["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _editor = _interopRequireDefault(require("./ui/editor"));
|
|
13
|
+
|
|
14
|
+
var _normalToolbar = _interopRequireDefault(require("./ui/normal-toolbar"));
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
+
|
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
+
|
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
+
|
|
22
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
23
|
+
|
|
24
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
25
|
+
|
|
26
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
27
|
+
|
|
28
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
29
|
+
|
|
30
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
31
|
+
|
|
32
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
|
+
|
|
34
|
+
// type Props = {}
|
|
35
|
+
function TitaRichEditor() {
|
|
36
|
+
var _useState = (0, _react.useState)(),
|
|
37
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
38
|
+
editor = _useState2[0],
|
|
39
|
+
setEditor = _useState2[1];
|
|
40
|
+
|
|
41
|
+
var handleInit = (0, _react.useCallback)(function (editor) {
|
|
42
|
+
return setEditor(editor);
|
|
43
|
+
}, []);
|
|
44
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
45
|
+
style: {
|
|
46
|
+
backgroundColor: '#fff'
|
|
47
|
+
}
|
|
48
|
+
}, /*#__PURE__*/_react["default"].createElement(_normalToolbar["default"], {
|
|
49
|
+
editor: editor
|
|
50
|
+
}), /*#__PURE__*/_react["default"].createElement(_editor["default"], {
|
|
51
|
+
onInit: handleInit
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
TitaRichEditor.ToolBar = _normalToolbar["default"];
|
|
56
|
+
TitaRichEditor.Editor = _editor["default"];
|
|
57
|
+
var _default = TitaRichEditor;
|
|
58
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.buildKeymap = buildKeymap;
|
|
7
|
+
|
|
8
|
+
var _prosemirrorCommands = require("prosemirror-commands");
|
|
9
|
+
|
|
10
|
+
var _list = require("./schemas/list");
|
|
11
|
+
|
|
12
|
+
var _prosemirrorHistory = require("prosemirror-history");
|
|
13
|
+
|
|
14
|
+
var _prosemirrorInputrules = require("prosemirror-inputrules");
|
|
15
|
+
|
|
16
|
+
var mac = typeof navigator != "undefined" ? /Mac/.test(navigator.platform) : false; // :: (Schema, ?Object) → Object
|
|
17
|
+
// Inspect the given schema looking for marks and nodes from the
|
|
18
|
+
// basic schema, and if found, add key bindings related to them.
|
|
19
|
+
// This will add:
|
|
20
|
+
//
|
|
21
|
+
// * **Mod-b** for toggling [strong](#schema-basic.StrongMark)
|
|
22
|
+
// * **Mod-i** for toggling [emphasis](#schema-basic.EmMark)
|
|
23
|
+
// * **Mod-`** for toggling [code font](#schema-basic.CodeMark)
|
|
24
|
+
// * **Ctrl-Shift-0** for making the current textblock a paragraph
|
|
25
|
+
// * **Ctrl-Shift-1** to **Ctrl-Shift-Digit6** for making the current
|
|
26
|
+
// textblock a heading of the corresponding level
|
|
27
|
+
// * **Ctrl-Shift-Backslash** to make the current textblock a code block
|
|
28
|
+
// * **Ctrl-Shift-8** to wrap the selection in an ordered list
|
|
29
|
+
// * **Ctrl-Shift-9** to wrap the selection in a bullet list
|
|
30
|
+
// * **Ctrl->** to wrap the selection in a block quote
|
|
31
|
+
// * **Enter** to split a non-empty textblock in a list item while at
|
|
32
|
+
// the same time splitting the list item
|
|
33
|
+
// * **Mod-Enter** to insert a hard break
|
|
34
|
+
// * **Mod-_** to insert a horizontal rule
|
|
35
|
+
// * **Backspace** to undo an input rule
|
|
36
|
+
// * **Alt-ArrowUp** to `joinUp`
|
|
37
|
+
// * **Alt-ArrowDown** to `joinDown`
|
|
38
|
+
// * **Mod-BracketLeft** to `lift`
|
|
39
|
+
// * **Escape** to `selectParentNode`
|
|
40
|
+
//
|
|
41
|
+
// You can suppress or map these bindings by passing a `mapKeys`
|
|
42
|
+
// argument, which maps key names (say `"Mod-B"` to either `false`, to
|
|
43
|
+
// remove the binding, or a new key name string.
|
|
44
|
+
|
|
45
|
+
function buildKeymap(schema, mapKeys) {
|
|
46
|
+
var keys = {},
|
|
47
|
+
type;
|
|
48
|
+
|
|
49
|
+
function bind(key, cmd) {
|
|
50
|
+
if (mapKeys) {
|
|
51
|
+
var mapped = mapKeys[key];
|
|
52
|
+
if (mapped === false) return;
|
|
53
|
+
if (mapped) key = mapped;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
keys[key] = cmd;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
bind("Mod-z", _prosemirrorHistory.undo);
|
|
60
|
+
bind("Shift-Mod-z", _prosemirrorHistory.redo);
|
|
61
|
+
bind("Backspace", _prosemirrorInputrules.undoInputRule);
|
|
62
|
+
if (!mac) bind("Mod-y", _prosemirrorHistory.redo);
|
|
63
|
+
bind("Alt-ArrowUp", _prosemirrorCommands.joinUp);
|
|
64
|
+
bind("Alt-ArrowDown", _prosemirrorCommands.joinDown);
|
|
65
|
+
bind("Mod-BracketLeft", _prosemirrorCommands.lift);
|
|
66
|
+
bind("Escape", _prosemirrorCommands.selectParentNode);
|
|
67
|
+
|
|
68
|
+
if (type = schema.marks.strong) {
|
|
69
|
+
bind("Mod-b", (0, _prosemirrorCommands.toggleMark)(type));
|
|
70
|
+
bind("Mod-B", (0, _prosemirrorCommands.toggleMark)(type));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (type = schema.marks.em) {
|
|
74
|
+
bind("Mod-i", (0, _prosemirrorCommands.toggleMark)(type));
|
|
75
|
+
bind("Mod-I", (0, _prosemirrorCommands.toggleMark)(type));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (type = schema.marks.code) bind("Mod-`", (0, _prosemirrorCommands.toggleMark)(type));
|
|
79
|
+
if (type = schema.nodes.bullet_list) bind("Shift-Ctrl-8", (0, _list.wrapInList)(type));
|
|
80
|
+
if (type = schema.nodes.ordered_list) bind("Shift-Ctrl-9", (0, _list.wrapInList)(type));
|
|
81
|
+
if (type = schema.nodes.blockquote) bind("Ctrl->", (0, _prosemirrorCommands.wrapIn)(type));
|
|
82
|
+
|
|
83
|
+
if (type = schema.nodes.hard_break) {
|
|
84
|
+
var br = type,
|
|
85
|
+
cmd = (0, _prosemirrorCommands.chainCommands)(_prosemirrorCommands.exitCode, function (state, dispatch) {
|
|
86
|
+
dispatch === null || dispatch === void 0 ? void 0 : dispatch(state.tr.replaceSelectionWith(br.create()).scrollIntoView());
|
|
87
|
+
return true;
|
|
88
|
+
});
|
|
89
|
+
bind("Mod-Enter", cmd);
|
|
90
|
+
bind("Shift-Enter", cmd);
|
|
91
|
+
if (mac) bind("Ctrl-Enter", cmd);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (type = schema.nodes.list_item) {
|
|
95
|
+
bind("Enter", (0, _list.splitListItem)(type));
|
|
96
|
+
bind("Tab", (0, _list.sinkListItem)(type));
|
|
97
|
+
bind("Shift-Tab", (0, _list.liftListItem)(type));
|
|
98
|
+
bind("Mod-[", (0, _list.liftListItem)(type));
|
|
99
|
+
bind("Mod-]", (0, _list.sinkListItem)(type));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (type = schema.nodes.paragraph) bind("Shift-Ctrl-0", (0, _prosemirrorCommands.setBlockType)(type));
|
|
103
|
+
if (type = schema.nodes.code_block) bind("Shift-Ctrl-\\", (0, _prosemirrorCommands.setBlockType)(type));
|
|
104
|
+
if (type = schema.nodes.heading) for (var i = 1; i <= 6; i++) {
|
|
105
|
+
bind("Shift-Ctrl-" + i, (0, _prosemirrorCommands.setBlockType)(type, {
|
|
106
|
+
level: i
|
|
107
|
+
}));
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (type = schema.nodes.horizontal_rule) {
|
|
111
|
+
var hr = type;
|
|
112
|
+
bind("Mod-_", function (state, dispatch) {
|
|
113
|
+
dispatch(state.tr.replaceSelectionWith(hr.create()).scrollIntoView());
|
|
114
|
+
return true;
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return keys;
|
|
119
|
+
}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.backspace = exports.altPaste = exports.addRowBefore = exports.addRowAfter = exports.addLink = exports.addColumnBefore = exports.addColumnAfter = exports.addAltText = exports.UP = exports.RIGHT = exports.LEFT = exports.KEY_6 = exports.KEY_5 = exports.KEY_4 = exports.KEY_3 = exports.KEY_2 = exports.KEY_1 = exports.KEY_0 = exports.HEADING_KEYS = exports.DOWN = void 0;
|
|
7
|
+
exports.bindKeymapWithCommand = bindKeymapWithCommand;
|
|
8
|
+
exports.escape = exports.enter = exports.deleteKey = exports.cut = exports.copy = exports.clearFormatting = void 0;
|
|
9
|
+
exports.findKeyMapForBrowser = findKeyMapForBrowser;
|
|
10
|
+
exports.findKeymapByDescription = findKeymapByDescription;
|
|
11
|
+
exports.findShortcutByDescription = findShortcutByDescription;
|
|
12
|
+
exports.findShortcutByKeymap = findShortcutByKeymap;
|
|
13
|
+
exports.undo = exports.toggleUnderline = exports.toggleTable = exports.toggleStrikethrough = exports.toggleOrderedList = exports.toggleItalic = exports.toggleHeading6 = exports.toggleHeading5 = exports.toggleHeading4 = exports.toggleHeading3 = exports.toggleHeading2 = exports.toggleHeading1 = exports.toggleCode = exports.toggleBulletList = exports.toggleBold = exports.toggleBlockQuote = exports.tab = exports.submit = exports.splitListItem = exports.splitCodeBlock = exports.space = exports.shiftBackspace = exports.setNormalText = exports.redoBarred = exports.redo = exports.previousCell = exports.pastePlainText = exports.paste = exports.outdentList = exports.outdent = exports.openHelp = exports.nextCell = exports.moveUp = exports.moveRight = exports.moveLeft = exports.moveDown = exports.insertRule = exports.insertNewLine = exports.indentList = exports.indent = void 0;
|
|
14
|
+
|
|
15
|
+
var _browser = _interopRequireDefault(require("../utils/browser"));
|
|
16
|
+
|
|
17
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
18
|
+
|
|
19
|
+
var addAltText = makeKeyMapWithCommon('Add Alt Text', 'Mod-Alt-y');
|
|
20
|
+
exports.addAltText = addAltText;
|
|
21
|
+
var toggleBold = makeKeyMapWithCommon('Bold', 'Mod-b');
|
|
22
|
+
exports.toggleBold = toggleBold;
|
|
23
|
+
var toggleItalic = makeKeyMapWithCommon('Italic', 'Mod-i');
|
|
24
|
+
exports.toggleItalic = toggleItalic;
|
|
25
|
+
var toggleUnderline = makeKeyMapWithCommon('Underline', 'Mod-u');
|
|
26
|
+
exports.toggleUnderline = toggleUnderline;
|
|
27
|
+
var toggleStrikethrough = makeKeyMapWithCommon('Strikethrough', 'Mod-Shift-s');
|
|
28
|
+
exports.toggleStrikethrough = toggleStrikethrough;
|
|
29
|
+
var toggleCode = makeKeyMapWithCommon('Code', 'Mod-Shift-m');
|
|
30
|
+
exports.toggleCode = toggleCode;
|
|
31
|
+
var pastePlainText = makeKeyMapWithCommon('Paste Plain Text', 'Mod-Shift-v');
|
|
32
|
+
exports.pastePlainText = pastePlainText;
|
|
33
|
+
var clearFormatting = makeKeyMapWithCommon('Clear formatting', 'Mod-\\');
|
|
34
|
+
exports.clearFormatting = clearFormatting;
|
|
35
|
+
var setNormalText = makeKeyMapWithCommon('Normal text', 'Mod-Alt-0');
|
|
36
|
+
exports.setNormalText = setNormalText;
|
|
37
|
+
var toggleHeading1 = makeKeyMapWithCommon('Heading 1', 'Mod-Alt-1');
|
|
38
|
+
exports.toggleHeading1 = toggleHeading1;
|
|
39
|
+
var toggleHeading2 = makeKeyMapWithCommon('Heading 2', 'Mod-Alt-2');
|
|
40
|
+
exports.toggleHeading2 = toggleHeading2;
|
|
41
|
+
var toggleHeading3 = makeKeyMapWithCommon('Heading 3', 'Mod-Alt-3');
|
|
42
|
+
exports.toggleHeading3 = toggleHeading3;
|
|
43
|
+
var toggleHeading4 = makeKeyMapWithCommon('Heading 4', 'Mod-Alt-4');
|
|
44
|
+
exports.toggleHeading4 = toggleHeading4;
|
|
45
|
+
var toggleHeading5 = makeKeyMapWithCommon('Heading 5', 'Mod-Alt-5');
|
|
46
|
+
exports.toggleHeading5 = toggleHeading5;
|
|
47
|
+
var toggleHeading6 = makeKeyMapWithCommon('Heading 6', 'Mod-Alt-6');
|
|
48
|
+
exports.toggleHeading6 = toggleHeading6;
|
|
49
|
+
var toggleOrderedList = makeKeyMapWithCommon('Numbered list', 'Mod-Shift-7');
|
|
50
|
+
exports.toggleOrderedList = toggleOrderedList;
|
|
51
|
+
var toggleBulletList = makeKeyMapWithCommon('Bullet list', 'Mod-Shift-8');
|
|
52
|
+
exports.toggleBulletList = toggleBulletList;
|
|
53
|
+
var toggleBlockQuote = makeKeymap('Quote', '', 'Cmd-Alt-9');
|
|
54
|
+
exports.toggleBlockQuote = toggleBlockQuote;
|
|
55
|
+
var insertNewLine = makeKeyMapWithCommon('Insert new line', 'Shift-Enter');
|
|
56
|
+
exports.insertNewLine = insertNewLine;
|
|
57
|
+
var shiftBackspace = makeKeyMapWithCommon('Shift Backspace', 'Shift-Backspace');
|
|
58
|
+
exports.shiftBackspace = shiftBackspace;
|
|
59
|
+
var splitCodeBlock = makeKeyMapWithCommon('Split code block', 'Enter');
|
|
60
|
+
exports.splitCodeBlock = splitCodeBlock;
|
|
61
|
+
var splitListItem = makeKeyMapWithCommon('Split list item', 'Enter');
|
|
62
|
+
exports.splitListItem = splitListItem;
|
|
63
|
+
var insertRule = makeKeyMapWithCommon('Insert horizontal rule', 'Mod-Shift--');
|
|
64
|
+
exports.insertRule = insertRule;
|
|
65
|
+
var undo = makeKeyMapWithCommon('Undo', 'Mod-z');
|
|
66
|
+
exports.undo = undo;
|
|
67
|
+
var moveUp = makeKeyMapWithCommon('Move up', 'ArrowUp');
|
|
68
|
+
exports.moveUp = moveUp;
|
|
69
|
+
var moveDown = makeKeyMapWithCommon('Move down', 'ArrowDown');
|
|
70
|
+
exports.moveDown = moveDown;
|
|
71
|
+
var moveLeft = makeKeyMapWithCommon('Move left', 'ArrowLeft');
|
|
72
|
+
exports.moveLeft = moveLeft;
|
|
73
|
+
var moveRight = makeKeyMapWithCommon('Move right', 'ArrowRight');
|
|
74
|
+
exports.moveRight = moveRight;
|
|
75
|
+
var indentList = makeKeyMapWithCommon('Indent List', 'Tab');
|
|
76
|
+
exports.indentList = indentList;
|
|
77
|
+
var outdentList = makeKeyMapWithCommon('Outdent List', 'Shift-Tab');
|
|
78
|
+
exports.outdentList = outdentList;
|
|
79
|
+
var redo = makeKeymap('Redo', 'Ctrl-y', 'Cmd-Shift-z');
|
|
80
|
+
exports.redo = redo;
|
|
81
|
+
var redoBarred = makeKeymap('Redo Barred', 'Ctrl-Shift-z', 'Cmd-y');
|
|
82
|
+
exports.redoBarred = redoBarred;
|
|
83
|
+
var openHelp = makeKeyMapWithCommon('Open Help', 'Mod-/');
|
|
84
|
+
exports.openHelp = openHelp;
|
|
85
|
+
var addLink = makeKeyMapWithCommon('Link', 'Mod-k');
|
|
86
|
+
exports.addLink = addLink;
|
|
87
|
+
var submit = makeKeyMapWithCommon('Submit Content', 'Mod-Enter');
|
|
88
|
+
exports.submit = submit;
|
|
89
|
+
var enter = makeKeyMapWithCommon('Enter', 'Enter');
|
|
90
|
+
exports.enter = enter;
|
|
91
|
+
var tab = makeKeyMapWithCommon('Tab', 'Tab');
|
|
92
|
+
exports.tab = tab;
|
|
93
|
+
var indent = makeKeyMapWithCommon('Indent', 'Tab');
|
|
94
|
+
exports.indent = indent;
|
|
95
|
+
var outdent = makeKeyMapWithCommon('Outdent', 'Shift-Tab');
|
|
96
|
+
exports.outdent = outdent;
|
|
97
|
+
var backspace = makeKeyMapWithCommon('Backspace', 'Backspace');
|
|
98
|
+
exports.backspace = backspace;
|
|
99
|
+
var deleteKey = makeKeyMapWithCommon('Delete', 'Delete');
|
|
100
|
+
exports.deleteKey = deleteKey;
|
|
101
|
+
var space = makeKeyMapWithCommon('Space', 'Space');
|
|
102
|
+
exports.space = space;
|
|
103
|
+
var escape = makeKeyMapWithCommon('Escape', 'Escape');
|
|
104
|
+
exports.escape = escape;
|
|
105
|
+
var nextCell = makeKeyMapWithCommon('Next cell', 'Tab');
|
|
106
|
+
exports.nextCell = nextCell;
|
|
107
|
+
var previousCell = makeKeyMapWithCommon('Previous cell', 'Shift-Tab');
|
|
108
|
+
exports.previousCell = previousCell;
|
|
109
|
+
var toggleTable = makeKeyMapWithCommon('Table', 'Shift-Alt-t');
|
|
110
|
+
exports.toggleTable = toggleTable;
|
|
111
|
+
var addRowBefore = makeKeyMapWithCommon('Add Row Above', 'Ctrl-Alt-ArrowUp');
|
|
112
|
+
exports.addRowBefore = addRowBefore;
|
|
113
|
+
var addRowAfter = makeKeyMapWithCommon('Add Row Below', 'Ctrl-Alt-ArrowDown');
|
|
114
|
+
exports.addRowAfter = addRowAfter;
|
|
115
|
+
var addColumnAfter = makeKeyMapWithCommon('Add Column After', 'Ctrl-Alt-ArrowRight');
|
|
116
|
+
exports.addColumnAfter = addColumnAfter;
|
|
117
|
+
var addColumnBefore = makeKeyMapWithCommon('Add Column Before', 'Ctrl-Alt-ArrowLeft');
|
|
118
|
+
exports.addColumnBefore = addColumnBefore;
|
|
119
|
+
var cut = makeKeyMapWithCommon('Cut', 'Mod-x');
|
|
120
|
+
exports.cut = cut;
|
|
121
|
+
var copy = makeKeyMapWithCommon('Copy', 'Mod-c');
|
|
122
|
+
exports.copy = copy;
|
|
123
|
+
var paste = makeKeyMapWithCommon('Paste', 'Mod-v');
|
|
124
|
+
exports.paste = paste;
|
|
125
|
+
var altPaste = makeKeyMapWithCommon('Paste', 'Mod-Shift-v');
|
|
126
|
+
exports.altPaste = altPaste;
|
|
127
|
+
var arrowKeysMap = {
|
|
128
|
+
// for reference: https://wincent.com/wiki/Unicode_representations_of_modifier_keys
|
|
129
|
+
ARROWLEFT: "\u2190",
|
|
130
|
+
ARROWRIGHT: "\u2192",
|
|
131
|
+
ARROWUP: "\u2191",
|
|
132
|
+
ARROWDOWN: "\u2193"
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
function formatShortcut(keymap) {
|
|
136
|
+
var shortcut;
|
|
137
|
+
|
|
138
|
+
if (_browser["default"].mac) {
|
|
139
|
+
// for reference: https://wincent.com/wiki/Unicode_representations_of_modifier_keys
|
|
140
|
+
shortcut = keymap.mac.replace(/Cmd/i, "\u2318").replace(/Shift/i, "\u21E7").replace(/Ctrl/i, "\u2303").replace(/Alt/i, "\u2325").replace(/Backspace/i, "\u232B");
|
|
141
|
+
} else {
|
|
142
|
+
shortcut = keymap.windows.replace(/Backspace/i, "\u232B");
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
var keys = shortcut.split('-');
|
|
146
|
+
var lastKey = keys[keys.length - 1].toUpperCase();
|
|
147
|
+
keys[keys.length - 1] = arrowKeysMap[lastKey] || lastKey;
|
|
148
|
+
return keys.join(_browser["default"].mac ? '' : '+');
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function findKeymapByDescription(description) {
|
|
152
|
+
var matches = ALL.filter(function (keymap) {
|
|
153
|
+
return keymap.description.toUpperCase() === description.toUpperCase();
|
|
154
|
+
});
|
|
155
|
+
return matches[0];
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function findShortcutByDescription(description) {
|
|
159
|
+
var keymap = findKeymapByDescription(description);
|
|
160
|
+
|
|
161
|
+
if (keymap) {
|
|
162
|
+
return findShortcutByKeymap(keymap);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function findShortcutByKeymap(keymap) {
|
|
169
|
+
if (_browser["default"].mac) {
|
|
170
|
+
return keymap.mac;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return keymap.windows;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
var ALL = [toggleOrderedList, toggleBulletList, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleCode, setNormalText, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleBlockQuote, insertNewLine, insertRule, splitCodeBlock, splitListItem, redo, undo];
|
|
177
|
+
|
|
178
|
+
function makeKeymap(description, windows, mac, common) {
|
|
179
|
+
return {
|
|
180
|
+
description: description,
|
|
181
|
+
windows: windows,
|
|
182
|
+
mac: mac,
|
|
183
|
+
common: common
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function makeKeyMapWithCommon(description, common) {
|
|
188
|
+
var windows = common.replace(/Mod/i, 'Ctrl');
|
|
189
|
+
var mac = common.replace(/Mod/i, 'Cmd');
|
|
190
|
+
return makeKeymap(description, windows, mac, common);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function bindKeymapWithCommand(shortcut, cmd, keymap) {
|
|
194
|
+
var oldCmd = keymap[shortcut];
|
|
195
|
+
var newCmd = cmd;
|
|
196
|
+
|
|
197
|
+
if (keymap[shortcut]) {
|
|
198
|
+
newCmd = function newCmd(state, dispatch, editorView) {
|
|
199
|
+
return oldCmd(state, dispatch) || cmd(state, dispatch, editorView);
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
keymap[shortcut] = newCmd;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function findKeyMapForBrowser(keyMap) {
|
|
207
|
+
if (keyMap) {
|
|
208
|
+
if (_browser["default"].mac) {
|
|
209
|
+
return keyMap.mac;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
return keyMap.windows;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
var LEFT = 37;
|
|
219
|
+
exports.LEFT = LEFT;
|
|
220
|
+
var RIGHT = 39;
|
|
221
|
+
exports.RIGHT = RIGHT;
|
|
222
|
+
var UP = 38;
|
|
223
|
+
exports.UP = UP;
|
|
224
|
+
var DOWN = 40;
|
|
225
|
+
exports.DOWN = DOWN;
|
|
226
|
+
var KEY_0 = 48;
|
|
227
|
+
exports.KEY_0 = KEY_0;
|
|
228
|
+
var KEY_1 = 49;
|
|
229
|
+
exports.KEY_1 = KEY_1;
|
|
230
|
+
var KEY_2 = 50;
|
|
231
|
+
exports.KEY_2 = KEY_2;
|
|
232
|
+
var KEY_3 = 51;
|
|
233
|
+
exports.KEY_3 = KEY_3;
|
|
234
|
+
var KEY_4 = 52;
|
|
235
|
+
exports.KEY_4 = KEY_4;
|
|
236
|
+
var KEY_5 = 53;
|
|
237
|
+
exports.KEY_5 = KEY_5;
|
|
238
|
+
var KEY_6 = 54;
|
|
239
|
+
exports.KEY_6 = KEY_6;
|
|
240
|
+
var HEADING_KEYS = [KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6];
|
|
241
|
+
exports.HEADING_KEYS = HEADING_KEYS;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
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); } }
|
|
9
|
+
|
|
10
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
11
|
+
|
|
12
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
13
|
+
|
|
14
|
+
var BaseController = /*#__PURE__*/_createClass(function BaseController() {
|
|
15
|
+
_classCallCheck(this, BaseController);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
exports["default"] = BaseController;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
|
+
|
|
10
|
+
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); } }
|
|
11
|
+
|
|
12
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
|
+
|
|
14
|
+
var TitaRichEditor = /*#__PURE__*/function () {
|
|
15
|
+
function TitaRichEditor(_ref) {
|
|
16
|
+
var view = _ref.view,
|
|
17
|
+
controllers = _ref.controllers,
|
|
18
|
+
dispatcher = _ref.dispatcher;
|
|
19
|
+
|
|
20
|
+
_classCallCheck(this, TitaRichEditor);
|
|
21
|
+
|
|
22
|
+
this.view = view;
|
|
23
|
+
this.controllers = controllers;
|
|
24
|
+
this.eventDispatcher = dispatcher;
|
|
25
|
+
this.on = dispatcher.on.bind(dispatcher);
|
|
26
|
+
this.off = dispatcher.off.bind(dispatcher);
|
|
27
|
+
this.emit = dispatcher.emit.bind(dispatcher);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
_createClass(TitaRichEditor, [{
|
|
31
|
+
key: "state",
|
|
32
|
+
get: function get() {
|
|
33
|
+
return this.view.state;
|
|
34
|
+
}
|
|
35
|
+
}, {
|
|
36
|
+
key: "destroy",
|
|
37
|
+
value: function destroy() {
|
|
38
|
+
this.eventDispatcher.destroy();
|
|
39
|
+
this.view.destroy();
|
|
40
|
+
this.controllers = [];
|
|
41
|
+
}
|
|
42
|
+
}]);
|
|
43
|
+
|
|
44
|
+
return TitaRichEditor;
|
|
45
|
+
}();
|
|
46
|
+
|
|
47
|
+
exports["default"] = TitaRichEditor;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
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); } }
|
|
9
|
+
|
|
10
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
11
|
+
|
|
12
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
13
|
+
|
|
14
|
+
var BasePlugin = /*#__PURE__*/_createClass(function BasePlugin() {
|
|
15
|
+
_classCallCheck(this, BasePlugin);
|
|
16
|
+
|
|
17
|
+
this.name = '';
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
exports["default"] = BasePlugin;
|