@titaui/pc 1.10.35 → 1.10.39
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/lib/components/avatar/default.js +1 -1
- package/lib/components/avatar/name-avatar/index.js +1 -1
- package/lib/components/avatar/text-avatar/index.js +1 -1
- package/lib/components/book-demo/components/pc/components/checkbox/index.js +3 -3
- package/lib/components/book-demo/components/pc/components/content/index.js +3 -3
- package/lib/components/book-demo/components/pc/components/drop-select/index.js +1 -1
- package/lib/components/book-demo/components/pc/components/input/index.js +1 -1
- package/lib/components/book-demo/components/pc/components/phone/index.js +1 -1
- package/lib/components/book-demo/components/pc/components/verify-code/index.js +1 -1
- package/lib/components/book-demo/components/pc/index.js +1 -1
- package/lib/components/book-demo/utils.js +6 -2
- package/lib/components/cascader/index.js +1 -1
- package/lib/components/cascader/time.js +1 -1
- package/lib/components/change-okr-modal/Filter.js +5 -5
- package/lib/components/change-okr-modal/Item.js +5 -5
- package/lib/components/change-okr-modal/filterTab.js +3 -3
- package/lib/components/change-okr-modal/index.js +5 -5
- package/lib/components/checkbox/index.js +1 -1
- package/lib/components/common-share/index.js +1 -1
- package/lib/components/common-share/publishMblog.js +3 -3
- package/lib/components/communication/CommunicationAttachments.js +3 -3
- package/lib/components/communication/CommunicationRecord.js +1 -1
- package/lib/components/communication/ConvertUserName.js +3 -3
- package/lib/components/communication/index.js +3 -3
- package/lib/components/confidence/index.js +1 -1
- package/lib/components/create-okr-modal/createCycle.js +3 -3
- package/lib/components/create-okr-modal/createSuccessCmp.js +1 -1
- package/lib/components/create-okr-modal/fields/date-cycle.js +1 -1
- package/lib/components/create-okr-modal/fields/o-new-name.js +1 -1
- package/lib/components/create-okr-modal/fields/okr-case.js +1 -1
- package/lib/components/create-okr-modal/fields/okr-create-suggest.js +1 -1
- package/lib/components/create-okr-modal/fields/okr-new-user-selector.js +1 -1
- package/lib/components/create-okr-modal/fields/okr-parent.js +1 -1
- package/lib/components/create-okr-modal/fields/okr-type-detail.js +1 -1
- package/lib/components/create-okr-modal/fields/okr-type.js +1 -1
- package/lib/components/create-okr-modal/fields/okr-visibility-detail.js +1 -1
- package/lib/components/create-okr-modal/fields/okr-visibility.js +1 -1
- package/lib/components/create-okr-modal/index.js +3 -3
- package/lib/components/create-okr-modal/kr-items/kr-item-weight.js +3 -3
- package/lib/components/create-okr-modal/kr-items/krDatas.js +3 -3
- package/lib/components/create-okr-modal/kr-items/krItem.js +3 -3
- package/lib/components/create-okr-modal/objectType.js +3 -3
- package/lib/components/create-okr-modal/request-api.js +2 -2
- package/lib/components/create-okr-modal/utils/helper.js +2 -2
- package/lib/components/date-picker/BodyItem.js +6 -6
- package/lib/components/date-picker/CalendarBody.js +3 -3
- package/lib/components/date-picker/CalendarHeader.js +6 -6
- package/lib/components/date-picker/index.js +3 -3
- package/lib/components/date-range-picker/index.js +3 -3
- package/lib/components/delete-confirm-pop/ConfirmPop.js +6 -6
- package/lib/components/dialog/index.js +1 -1
- package/lib/components/drawer/headerAction.js +3 -3
- package/lib/components/drawer/headerDrop.js +1 -1
- package/lib/components/drawer/index.js +3 -3
- package/lib/components/drawer/utils/useForceUpdate.js +1 -1
- package/lib/components/drawer-manager/drawerWrapper.js +1 -1
- package/lib/components/drawer-manager/index.js +3 -3
- package/lib/components/drawer-manager/utils/useForceUpdate.js +1 -1
- package/lib/components/drop-selector/index.js +3 -3
- package/lib/components/dynamic/advertise/index.js +1 -1
- package/lib/components/dynamic/advertise/util.js +2 -2
- package/lib/components/dynamic/components/dynamic-search-input/index.js +1 -1
- package/lib/components/dynamic/components/first-level-tabs/index.js +1 -1
- package/lib/components/dynamic/components/title/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/components/header/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-align/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-announcement/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-assessment/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-chart/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-learning/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-okrs-communication/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-plan-communication/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-project/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-relative/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-reply/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-report/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-reward/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-share/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/index.js +3 -3
- package/lib/components/dynamic/dynamic-like-ranking/index.js +1 -1
- package/lib/components/dynamic/dynamic-liking/index.js +1 -1
- package/lib/components/dynamic/dynamic-topping/index.js +1 -1
- package/lib/components/dynamic/dynamic-topping/item.js +1 -1
- package/lib/components/dynamic/dynamic.js +1 -1
- package/lib/components/dynamic/index.js +1 -1
- package/lib/components/dynamic/my-team/index.js +1 -1
- package/lib/components/dynamic/quick-operation/components/create-task/index.js +1 -1
- package/lib/components/dynamic/quick-operation/index.js +1 -1
- package/lib/components/dynamic/request-api.js +2 -2
- package/lib/components/e-priority/index.js +1 -1
- package/lib/components/eReport/eReportListEmpty.js +3 -3
- package/lib/components/eReport/eReportLists/reportList.js +6 -6
- package/lib/components/eReport/eReportShare/index.js +3 -3
- package/lib/components/eReport/eReportShare/toast/index.js +3 -3
- package/lib/components/edit-kr-wight/EditKrWightModal.js +5 -5
- package/lib/components/edit-kr-wight/FormItemV2.js +3 -3
- package/lib/components/edit-kr-wight/utils.js +2 -2
- package/lib/components/emotions-selector/selector-content.js +3 -3
- package/lib/components/emotions-selector/selector-pop.js +6 -6
- package/lib/components/ereport-list/index.js +6 -6
- package/lib/components/error-boundary/index.js +3 -3
- package/lib/components/file-list/components/single-file/index.js +1 -1
- package/lib/components/file-list/index.js +1 -1
- package/lib/components/firework/index.js +2 -2
- package/lib/components/follower-visitor/index.js +1 -1
- package/lib/components/form/form-fields/department/index.js +1 -1
- package/lib/components/form/form-fields/dropdown/index.js +1 -1
- package/lib/components/form/form-fields/duties/index.js +1 -1
- package/lib/components/form/form-fields/group/index.js +1 -1
- package/lib/components/form/form-fields/input/index.js +1 -1
- package/lib/components/form/form-fields/input-verification-code/index.js +1 -1
- package/lib/components/form/form-fields/password/index.js +1 -1
- package/lib/components/form/form-fields/radios/index.js +1 -1
- package/lib/components/form/form-fields/textarea/index.js +1 -1
- package/lib/components/form/form-fields/user/index.js +1 -1
- package/lib/components/form/index.js +3 -3
- package/lib/components/grid-layout/commen-components/card-title.js +1 -1
- package/lib/components/grid-layout/commen-components/data-item.js +1 -1
- package/lib/components/grid-layout/commen-components/scroll-tips.js +1 -1
- package/lib/components/grid-layout/essay-component/index.js +1 -1
- package/lib/components/grid-layout/near-visitors/index.js +1 -1
- package/lib/components/grid-layout/near-visitors/visitor.js +1 -1
- package/lib/components/grid-layout/okr-align/index.js +1 -1
- package/lib/components/grid-layout/okr-progress/index.js +1 -1
- package/lib/components/grid-layout/okr-target/index.js +1 -1
- package/lib/components/grid-layout/over-view/index.js +1 -1
- package/lib/components/grid-layout/personal-info/index.js +1 -1
- package/lib/components/grid-layout/sub-employee-okr/index.js +1 -1
- package/lib/components/grid-layout/sub-employee-okr/person-okr.js +1 -1
- package/lib/components/grid-layout/util/click-link.js +2 -2
- package/lib/components/grid-layout/week-task/index.js +1 -1
- package/lib/components/grid-layout/words-cloud/index.js +1 -1
- package/lib/components/grid-page/commen-components/scroll-tips.js +1 -1
- package/lib/components/grid-page/near-visitors/visitor.js +1 -1
- package/lib/components/grid-page/personal-info/index.js +1 -1
- package/lib/components/help-card/index.js +1 -1
- package/lib/components/hr-header/index.js +1 -1
- package/lib/components/img-viewer/index.js +1 -1
- package/lib/components/keyword-search/index.js +1 -1
- package/lib/components/mblog/components/ConfirmPop.js +3 -3
- package/lib/components/mblog/components/MblogAction.js +6 -6
- package/lib/components/mblog/components/MblogContent.js +3 -3
- package/lib/components/mblog/index.js +3 -3
- package/lib/components/menus/components/drag-resize/index.js +1 -1
- package/lib/components/menus/components/flip-menu-card/index.js +1 -1
- package/lib/components/menus/components/menu-card/index.js +3 -3
- package/lib/components/menus/components/menu-tree/tree-node/avatar/index.js +1 -1
- package/lib/components/menus/components/menu-tree/tree-node/company-all.js +1 -1
- package/lib/components/menus/components/menu-tree/tree-node/compony/index.js +1 -1
- package/lib/components/menus/components/menu-tree/tree-node/depart/index.js +1 -1
- package/lib/components/menus/components/menu-tree/tree-node/follower/index.js +1 -1
- package/lib/components/menus/components/menu-tree/tree-node/user/index.js +1 -1
- package/lib/components/menus/components/menu-tree/tree-node/user-concern.js +1 -1
- package/lib/components/menus/components/search-colleague/index.js +1 -1
- package/lib/components/menus/export-modules/appraisal-menus/index.js +1 -1
- package/lib/components/menus/export-modules/appraisal-menus/menu-highlight.js +1 -1
- package/lib/components/menus/export-modules/appraisal-menus/menus.js +1 -1
- package/lib/components/menus/export-modules/demo-menus/index.js +1 -1
- package/lib/components/menus/export-modules/demo-menus/menu-highlight.js +1 -1
- package/lib/components/menus/export-modules/demo-menus/menus.js +1 -1
- package/lib/components/menus/export-modules/manage-menus/handle-highlight.js +1 -1
- package/lib/components/menus/export-modules/manage-menus/index.js +1 -1
- package/lib/components/menus/export-modules/okr-menus/depart-menus/helper.js +2 -2
- package/lib/components/menus/export-modules/okr-menus/depart-menus/index.js +1 -1
- package/lib/components/menus/export-modules/okr-menus/index.js +1 -1
- package/lib/components/menus/export-modules/okr-menus/menu-highlight.js +1 -1
- package/lib/components/menus/export-modules/okr-menus/menus.js +1 -1
- package/lib/components/menus/export-modules/okr-menus/okr-front-menus.js +1 -1
- package/lib/components/menus/export-modules/okr-menus/subordinate-menus/index.js +1 -1
- package/lib/components/menus/i18n.js +6 -2
- package/lib/components/nav-top/components/menu/index.js +1 -1
- package/lib/components/nav-top/components/user-message/components/inform/index.js +1 -1
- package/lib/components/nav-top/components/user-message/components/inform/inform-item.js +1 -1
- package/lib/components/nav-top/components/user-message/components/red-pack/index.js +1 -1
- package/lib/components/nav-top/components/user-message/components/remind/index.js +1 -1
- package/lib/components/nav-top/components/user-message/components/reply/index.js +1 -1
- package/lib/components/nav-top/components/user-message/components/todos/index.js +1 -1
- package/lib/components/nav-top/components/user-message/hrMessage.js +1 -1
- package/lib/components/nav-top/components/user-message/index.js +1 -1
- package/lib/components/nav-top/components/user-message/msg/index.js +1 -1
- package/lib/components/nav-top/components/user-own-menu/components/own-menu/index.js +1 -1
- package/lib/components/nav-top/components/version/index.js +1 -1
- package/lib/components/nav-top/index.js +1 -1
- package/lib/components/okr-detail/auth.js +3 -3
- package/lib/components/okr-detail/base-info/base-info.js +3 -3
- package/lib/components/okr-detail/base-info/o-desc/index.js +1 -1
- package/lib/components/okr-detail/base-info/other-infos/classify/index.js +1 -1
- package/lib/components/okr-detail/base-info/other-infos/common/border-wrapper/index.js +1 -1
- package/lib/components/okr-detail/base-info/other-infos/date-cycle/index.js +1 -1
- package/lib/components/okr-detail/base-info/other-infos/okr-type/index.js +1 -1
- package/lib/components/okr-detail/base-info/other-infos/other-infos.js +3 -3
- package/lib/components/okr-detail/base-info/other-infos/principal/index.js +1 -1
- package/lib/components/okr-detail/base-info/other-infos/visibility/index.js +1 -1
- package/lib/components/okr-detail/base-info/person/index.js +1 -1
- package/lib/components/okr-detail/base-info/util.js +2 -2
- package/lib/components/okr-detail/components/ao-nice/index.js +1 -1
- package/lib/components/okr-detail/components/base-okr-type/confirm/buttonv2.js +3 -3
- package/lib/components/okr-detail/components/base-okr-type/confirm/confirm.js +3 -3
- package/lib/components/okr-detail/components/base-okr-type/index.js +1 -1
- package/lib/components/okr-detail/components/base-okr-type/object-type.js +3 -3
- package/lib/components/okr-detail/components/editable-input/index.js +1 -1
- package/lib/components/okr-detail/components/header/edit-name.js +1 -1
- package/lib/components/okr-detail/components/header/index.js +1 -1
- package/lib/components/okr-detail/components/header/o-avatar.js +1 -1
- package/lib/components/okr-detail/components/header/o-cycle.js +1 -1
- package/lib/components/okr-detail/components/header/o-score.js +3 -3
- package/lib/components/okr-detail/components/icon-text/index.js +1 -1
- package/lib/components/okr-detail/components/o-classify.js +1 -1
- package/lib/components/okr-detail/components/o-progress-update/index.js +3 -3
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-priority-dropdown.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-project.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-status-dropdown.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-task-level2.js +3 -3
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-task.js +3 -3
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/edit-pop.js +8 -8
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/kr-push-score.js +3 -3
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/range-picker-pop.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-parent-node/index.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/edit-child-okr-weight.js +3 -3
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/index.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/weight-input.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-parent-node/index.js +1 -1
- package/lib/components/okr-detail/components/okr-type.js +1 -1
- package/lib/components/okr-detail/detail-footer/index.js +1 -1
- package/lib/components/okr-detail/detail-header/actions.js +2 -2
- package/lib/components/okr-detail/detail-header/confirm.js +1 -1
- package/lib/components/okr-detail/detail-header/delete-confirm/delete-confirm.js +1 -1
- package/lib/components/okr-detail/detail-header/index.js +3 -3
- package/lib/components/okr-detail/e-list/index.js +1 -1
- package/lib/components/okr-detail/e-list/search-form/fields/e-order.js +1 -1
- package/lib/components/okr-detail/e-list/search-form/fields/e-status.js +1 -1
- package/lib/components/okr-detail/e-list/search-form/index.js +1 -1
- package/lib/components/okr-detail/e-list/util.js +2 -2
- package/lib/components/okr-detail/index.js +3 -3
- package/lib/components/okr-detail/okr-list/add-parent-okr.js +1 -1
- package/lib/components/okr-detail/okr-list/create-kr-item/heart.js +1 -1
- package/lib/components/okr-detail/okr-list/create-kr-item/index.js +3 -3
- package/lib/components/okr-detail/okr-list/drag-order-kr.js +2 -2
- package/lib/components/okr-detail/okr-list/index.js +3 -3
- package/lib/components/okr-detail/request-apis.js +2 -2
- package/lib/components/okr-detail/schedule/components/o-progress/index.js +1 -1
- package/lib/components/okr-detail/schedule/schedule.js +1 -1
- package/lib/components/okr-filter-drawer/filter-form.js +3 -3
- package/lib/components/okr-flow/child-node/fields/creator.js +1 -1
- package/lib/components/okr-flow/child-node/index.js +1 -1
- package/lib/components/okr-flow/child-node/work-node.js +1 -1
- package/lib/components/okr-flow/export-modal/index.js +1 -1
- package/lib/components/okr-flow/export-modules/okr-search-panel/index.js +3 -3
- package/lib/components/okr-flow/mini-map/index.js +1 -1
- package/lib/components/okr-flow/mini-map/map.js +1 -1
- package/lib/components/okr-flow/mini-map/mini-node.js +1 -1
- package/lib/components/okr-flow/mini-map/utils.js +2 -2
- package/lib/components/okr-flow/okr-map/index.js +1 -1
- package/lib/components/okr-flow/open-data/index.js +3 -3
- package/lib/components/okr-flow/request-apis.js +2 -2
- package/lib/components/okr-flow/root-node/index.js +1 -1
- package/lib/components/okr-period-selector/index.js +1 -1
- package/lib/components/okr-period-selector/select-cycle.js +3 -3
- package/lib/components/okr-progress/components/o-progress/index.js +1 -1
- package/lib/components/okr-progress/components/o-progress-update/index.js +3 -3
- package/lib/components/okr-progress/okr-progress/index.js +1 -1
- package/lib/components/okr-progress/request-apis.js +2 -2
- package/lib/components/okr-progress-detail/index.js +1 -1
- package/lib/components/okr-progress-modal/helper.js +1 -1
- package/lib/components/okr-progress-modal/index.js +1 -1
- package/lib/components/okr-progress-modal/textarea/index.js +1 -1
- package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +5 -5
- package/lib/components/okr-review/ReviewPop/components/Toast/index.js +3 -3
- package/lib/components/okr-review/ReviewPop/index.js +5 -5
- package/lib/components/okr-review/components/ReviewItem/index.js +6 -6
- package/lib/components/okr-review/components/confirm-pop/ConfirmPop.js +6 -6
- package/lib/components/okr-review/index.js +3 -3
- package/lib/components/okr-share/index.js +1 -1
- package/lib/components/okr-share/publishMblog.js +3 -3
- package/lib/components/okr-share/shareCardSelector.js +1 -1
- package/lib/components/okrcase-library/index.js +1 -1
- package/lib/components/okrcase-library/okrcases-components/caseLibrary-cardList/index.js +1 -1
- package/lib/components/okrcase-library/okrcases-components/caseLibrary-cardList/okrcase-card.js +1 -1
- package/lib/components/okrcase-library/okrcases-components/caseLibrary-nav.js +1 -1
- package/lib/components/okrcase-library/okrcases-components/caseLibray-header.js +1 -1
- package/lib/components/okrcase-library/okrcases-components/submitOkr-dialog.js +1 -1
- package/lib/components/okrcase-library/server/network.js +2 -2
- package/lib/components/okrcase-library-card/index.js +1 -1
- package/lib/components/operation-records/OperationRecordItem.js +3 -3
- package/lib/components/operation-records/index.js +3 -3
- package/lib/components/part-notice/index.js +1 -1
- package/lib/components/password-input/index.js +1 -1
- package/lib/components/period-selector/common.js +2 -2
- package/lib/components/period-selector/components/button/index.js +1 -1
- package/lib/components/period-selector/components/selector/index.js +3 -3
- package/lib/components/period-selector/helper/index.js +2 -2
- package/lib/components/period-selector/index.js +1 -1
- package/lib/components/photo-card/components/card/index.js +1 -1
- package/lib/components/photo-card/index.js +1 -1
- package/lib/components/point-demo/drop-down-box/index.js +1 -1
- package/lib/components/point-demo/index.js +1 -1
- package/lib/components/point-demo/input/index.js +3 -3
- package/lib/components/point-demo/point-demo.js +1 -1
- package/lib/components/point-demo/popup/index.js +1 -1
- package/lib/components/popup/index.js +1 -1
- package/lib/components/praise-record/PraiseRecordItem.js +3 -3
- package/lib/components/praise-record/index.js +3 -3
- package/lib/components/publish-dynamic-modal/publish-dynamic-modal.js +1 -1
- package/lib/components/publish-dynamic-modal/requist-api.js +2 -2
- package/lib/components/radio/radio.js +1 -1
- package/lib/components/radio/radioGroup.js +2 -2
- package/lib/components/range-picker-pop/index.js +3 -3
- package/lib/components/range-selector-pop/RangeList.js +3 -3
- package/lib/components/range-selector-pop/RangeSelectorPop.js +6 -6
- 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 +126 -0
- package/lib/components/rich-editor/plugins/block/heading/commonds.js +31 -0
- package/lib/components/rich-editor/plugins/block/heading/index.js +188 -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 +398 -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 +222 -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 +111 -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/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 +209 -0
- package/lib/components/rich-editor/plugins/inline/color/selector.js +252 -0
- package/lib/components/rich-editor/plugins/inline/delete-line/index.js +147 -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 +79 -0
- package/lib/components/rich-editor/plugins/inline/link/ui/linkEditor.js +148 -0
- package/lib/components/rich-editor/plugins/inline/link/ui/linkToolbar.js +88 -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 +137 -0
- package/lib/components/rich-editor/plugins/inline/under-line/index.js +145 -0
- package/lib/components/rich-editor/plugins/util.js +281 -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 +141 -0
- package/lib/components/rich-editor/ui/editor/index.js +130 -0
- package/lib/components/rich-editor/ui/normal-toolbar/index.css +28 -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 +160 -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/simplebar/simplebar.js +3 -3
- package/lib/components/scrollbar/simplebar-react.js +3 -3
- package/lib/components/search-dropdown/index.js +1 -1
- package/lib/components/search-input/index.js +3 -3
- package/lib/components/select/Option.js +8 -8
- package/lib/components/select/index.js +5 -5
- package/lib/components/select-layer/index.js +1 -1
- package/lib/components/select-tags/index.js +1 -1
- package/lib/components/selector-input/index.js +1 -1
- package/lib/components/slider-input/index.js +1 -1
- package/lib/components/stateless-dropdown/stateless-dropdown.js +1 -1
- package/lib/components/status-time/index.js +1 -1
- package/lib/components/stop-taking-modal/index.js +1 -1
- package/lib/components/superset-charts/components/chart/index.js +1 -1
- package/lib/components/superset-charts/init/insert-assets.js +1 -1
- package/lib/components/superset-charts/utils/axios.js +2 -2
- package/lib/components/table/index.js +1 -1
- package/lib/components/tabs/index.js +1 -1
- package/lib/components/task-relation-modal/index.js +1 -1
- package/lib/components/task-relation-modal/radio.js +1 -1
- package/lib/components/task-relation-modal/request-api.js +2 -2
- package/lib/components/task-relation-modal/search/category-select.js +1 -1
- package/lib/components/task-relation-modal/search/okr-status-select.js +1 -1
- package/lib/components/task-relation-modal/search/okr-type-select.js +1 -1
- package/lib/components/task-relation-modal/search/principal.js +1 -1
- package/lib/components/task-relation-modal/search/relation.js +1 -1
- package/lib/components/task-relation-modal/tree/category-tree/index.js +3 -3
- package/lib/components/task-relation-modal/tree/category-tree/search-form.js +1 -1
- package/lib/components/task-relation-modal/tree/okr-tree/index.js +3 -3
- package/lib/components/task-relation-modal/tree/okr-tree/search-form.js +3 -3
- package/lib/components/task-relation-modal/tree/work-tree/index.js +3 -3
- package/lib/components/task-relation-modal/tree/work-tree/search-form.js +1 -1
- package/lib/components/task-relation-modal/tree-node/category-node/index.js +1 -1
- package/lib/components/task-relation-modal/tree-node/kr-node/index.js +1 -1
- package/lib/components/task-relation-modal/tree-node/milestone-node/index.js +1 -1
- package/lib/components/task-relation-modal/tree-node/o-node/index.js +1 -1
- package/lib/components/task-relation-modal/tree-node/work-node/index.js +1 -1
- package/lib/components/tita-chart/charts/liquid-ball.js +1 -1
- package/lib/components/tita-chart/charts/pie.js +2 -2
- package/lib/components/tita-chart/charts/words-cloud.js +2 -2
- package/lib/components/tita-chart/errorBoundary/index.js +6 -6
- package/lib/components/tita-chart/hooks/useChart.js +3 -3
- package/lib/components/tita-chart/plots/liquid/index.js +1 -1
- package/lib/components/tita-chart/plots/pie/index.js +1 -1
- package/lib/components/tita-chart/plots/wordscloud/index.js +1 -1
- package/lib/components/toast/index.js +1 -1
- package/lib/components/tooltip/tooltip-text/index.js +1 -1
- package/lib/components/top-global-prompt/index.js +1 -1
- package/lib/components/update-modal/index.js +1 -1
- package/lib/components/upload/components/uploadedPreview.js +3 -3
- package/lib/components/upload/index.js +9 -7
- package/lib/components/upload-photo-modal/index.js +1 -1
- package/lib/components/upvote/index.js +3 -3
- package/lib/components/upvote/selector.js +1 -1
- package/lib/components/upvote/upvoteListModal.js +1 -1
- package/lib/components/user-selector/category-selector-panel/depart-tree.js +1 -1
- package/lib/components/user-selector/category-selector-panel/group-tree.js +1 -1
- package/lib/components/user-selector/category-selector-panel/index.js +1 -1
- package/lib/components/user-selector/export-modules/depart-search-selector/index.js +1 -1
- package/lib/components/user-selector/export-modules/duties-selector/index.js +3 -3
- package/lib/components/user-selector/export-modules/field-tree-selector/index.js +1 -1
- package/lib/components/user-selector/export-modules/field-tree-selector/multiple-selector/index.js +1 -1
- package/lib/components/user-selector/export-modules/field-tree-selector/single-selector/index.js +1 -1
- package/lib/components/user-selector/export-modules/field-tree-selector/single-selector/user-list.js +1 -1
- package/lib/components/user-selector/export-modules/group-selector/index.js +1 -1
- package/lib/components/user-selector/export-modules/group-selector/searched-panel.js +1 -1
- package/lib/components/user-selector/export-modules/multiple-user-selector--bak/index.js +1 -1
- package/lib/components/user-selector/export-modules/single-selector/index.js +1 -1
- package/lib/components/user-selector/searched-panel/index.js +1 -1
- package/lib/components/user-selector/select-tree/choose-tree/index.js +1 -1
- package/lib/components/user-selector/select-tree/selected-tree/index.js +1 -1
- package/lib/components/user-selector/select-tree/tree-nodes/tree-group-node/index.js +1 -1
- package/lib/components/user-selector/select-tree/tree-nodes/tree-person-node/index.js +1 -1
- package/lib/components/user-selector/selected-panel/index.js +1 -1
- package/lib/components/user-selector/utils.js +2 -2
- package/lib/components/version-change-modal/index.js +1 -1
- package/lib/components/video-modal/components/video-box/index.js +1 -1
- package/lib/components/video-modal/index.js +1 -1
- package/lib/components/viewer/ImageListRender.js +5 -5
- package/lib/components/viewer/index.js +5 -5
- package/lib/components/weekly-report/card.js +1 -1
- package/lib/components/weekly-report/index.js +1 -1
- package/lib/components/word-cloud/index.js +1 -1
- package/lib/components-v1/animate/AnimateChild.js +6 -6
- package/lib/components-v1/animate/animate.js +3 -3
- package/lib/components-v1/avatar/index.js +6 -6
- package/lib/components-v1/buttonv2/ButtonOutlined.js +3 -3
- package/lib/components-v1/buttonv2/ButtonRounded.js +3 -3
- package/lib/components-v1/buttonv2/DefaultButton.js +3 -3
- package/lib/components-v1/buttonv2/style/style.js +1 -1
- package/lib/components-v1/confirm/index.js +3 -3
- package/lib/components-v1/dropDownSelector/StatelessDropdown.js +6 -6
- package/lib/components-v1/dropDownSelector/dropDownSelector.js +3 -3
- package/lib/components-v1/input/Input.js +3 -3
- package/lib/components-v1/input/InputNumber.js +3 -3
- package/lib/components-v1/placement/placement.js +3 -3
- package/lib/components-v1/placement/placementInner.js +5 -5
- package/lib/components-v1/pop/Pop.js +3 -3
- package/lib/components-v1/pop/PopInner.js +5 -5
- package/lib/components-v1/popConfirm/index.js +1 -1
- package/lib/components-v1/portals/Portals.js +3 -3
- package/lib/components-v1/progress/CircleProgress.js +6 -6
- package/lib/components-v1/progress/LineProgress.js +3 -3
- package/lib/components-v1/progress/index.js +3 -3
- package/lib/components-v1/radio/radio.js +3 -3
- package/lib/components-v1/radio/radioGroup.js +3 -3
- package/lib/components-v1/search/cache.js +3 -3
- package/lib/components-v1/search/index.js +3 -3
- package/lib/components-v1/select/Option.js +8 -8
- package/lib/components-v1/select/index.js +5 -5
- package/lib/components-v1/tabs/index.js +3 -3
- package/lib/components-v1/textarea/index.js +3 -3
- package/lib/components-v1/transition/index.js +3 -3
- package/lib/components-v1/userSelector/UserSelectorPop.js +8 -8
- package/lib/components-v1/userSelector/components/MultiMode/CommonList.js +3 -3
- package/lib/components-v1/userSelector/components/MultiMode/DepartmentList.js +5 -5
- package/lib/components-v1/userSelector/components/MultiMode/DepartmentTree.js +3 -3
- package/lib/components-v1/userSelector/components/MultiMode/SubsList.js +3 -3
- package/lib/components-v1/userSelector/components/MultiMode/index.js +6 -6
- package/lib/components-v1/userSelector/components/SearchBar.js +3 -3
- package/lib/components-v1/userSelector/components/SingleMode.js +3 -3
- package/lib/components-v1/userSelector/components/UserItem.js +6 -6
- package/lib/components-v1/userSelector/index.js +3 -3
- package/lib/components-v1/utils/animate/animate.js +1 -1
- package/lib/index.js +8 -0
- package/lib/pages/aha2021/index.js +1 -1
- package/lib/pages/appointment-demo/drop-down-box/index.js +1 -1
- package/lib/pages/appointment-demo/index.js +1 -1
- package/lib/pages/appointment-demo/input/index.js +3 -3
- package/lib/pages/appointment-demo/popup/index.js +1 -1
- package/lib/pages/dynamic/index.js +1 -1
- package/lib/pages/group-management/components/checkbox/index.js +1 -1
- package/lib/pages/group-management/components/input-form/index.js +3 -3
- package/lib/pages/group-management/components/openData/index.js +3 -3
- package/lib/pages/group-management/components/table/index.js +1 -1
- package/lib/pages/group-management/groupInterface.js +2 -2
- package/lib/pages/group-management/page-view/empty.js +1 -1
- package/lib/pages/group-management/page-view/group-empty.js +1 -1
- package/lib/pages/group-management/page-view/importGroupStaff/index.js +1 -1
- package/lib/pages/group-management/page-view/index.js +1 -1
- package/lib/pages/group-management/page-view/loading/index.js +1 -1
- package/lib/pages/group-management/table/index.js +1 -1
- package/lib/pages/group-management/tree/add-group-dialog/index.js +1 -1
- package/lib/pages/group-management/tree/delete-group-dialog/index.js +1 -1
- package/lib/pages/group-management/tree/edit-group-dialog/index.js +1 -1
- package/lib/pages/group-management/tree/group-form/index.js +1 -1
- package/lib/pages/group-management/tree/index.js +1 -1
- package/lib/pages/group-management/tree/operation-panel.js +1 -1
- package/lib/pages/group-management/tree/trigger-render.js +1 -1
- package/lib/pages/home/components/data-list/index.js +1 -1
- package/lib/pages/home/components/data-list/table/columns/progressAndRisk.js +1 -1
- package/lib/pages/home/components/data-list/table/index.js +1 -1
- package/lib/pages/home/components/guide/index.js +1 -1
- package/lib/pages/home/components/header/index.js +1 -1
- package/lib/pages/home-page-data-list/index.js +1 -1
- package/lib/pages/like-ranking/filter-buttons/department.js +1 -1
- package/lib/pages/like-ranking/filter-buttons/modular.js +1 -1
- package/lib/pages/like-ranking/filter-buttons/name.js +1 -1
- package/lib/pages/like-ranking/index.js +3 -3
- package/lib/pages/new-okr-list/header/comments.js +1 -1
- package/lib/pages/new-okr-list/header/create-okr.js +1 -1
- package/lib/pages/new-okr-list/header/filter.js +1 -1
- package/lib/pages/new-okr-list/header/index.js +1 -1
- package/lib/pages/new-okr-list/index.js +3 -3
- package/lib/pages/new-okr-list/init-cycle-setting.js +1 -1
- package/lib/pages/new-okr-list/keyword-search/index.js +1 -1
- package/lib/pages/new-okr-list/request-api.js +2 -2
- package/lib/pages/okr-map/export-modules/okr-map/header/index.js +1 -1
- package/lib/pages/okr-map/export-modules/okr-map/okr-map.js +3 -3
- package/lib/pages/okr-map/export-modules/share-okr-page/header/index.js +1 -1
- package/lib/pages/okr-map/export-modules/share-okr-page/share-okr-map.js +1 -1
- package/lib/pages/okr-map/level2-search/group.js +3 -3
- package/lib/pages/okr-map/level2-search/index.js +1 -1
- package/lib/pages/okr-map/level2-search/user.js +1 -1
- package/lib/pages/okr-map/open-data/index.js +3 -3
- package/lib/pages/okr-map/share-dialog/index.js +1 -1
- package/lib/pages/okr-map/unsupport-ie/index.js +1 -1
- package/lib/pages/personal-info/components/base-info/index.js +3 -3
- package/lib/pages/personal-info/components/edit-base-info/index.js +3 -3
- package/lib/pages/personal-info/components/person-photo/index.js +1 -1
- package/lib/utils/auth.js +3 -3
- package/lib/utils/local-storage.js +1 -1
- package/lib/utils/open-data.js +3 -3
- package/lib/utils/request-v1.js +2 -2
- package/lib/utils/roundWeight.js +2 -2
- package/lib/utils/tools.js +2 -2
- package/package.json +20 -2
- package/yarn-error.log +22184 -0
|
@@ -0,0 +1,109 @@
|
|
|
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 _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _tooltip = _interopRequireDefault(require("../../../tooltip"));
|
|
15
|
+
|
|
16
|
+
require("./index.css");
|
|
17
|
+
|
|
18
|
+
var _events = require("../../consts/events");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
+
|
|
22
|
+
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); }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
27
|
+
|
|
28
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
29
|
+
|
|
30
|
+
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."); }
|
|
31
|
+
|
|
32
|
+
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); }
|
|
33
|
+
|
|
34
|
+
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; }
|
|
35
|
+
|
|
36
|
+
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; }
|
|
37
|
+
|
|
38
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
39
|
+
|
|
40
|
+
var preCls = 'tita-rich-editor-normal-toolbar';
|
|
41
|
+
|
|
42
|
+
function MenuItem(_ref) {
|
|
43
|
+
var _config$active, _config$disabled, _classNames;
|
|
44
|
+
|
|
45
|
+
var editor = _ref.editor,
|
|
46
|
+
config = _ref.config;
|
|
47
|
+
|
|
48
|
+
var _useState = (0, _react.useState)(editor.state),
|
|
49
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
50
|
+
state = _useState2[0],
|
|
51
|
+
setState = _useState2[1];
|
|
52
|
+
|
|
53
|
+
var handleClickItem = (0, _react.useCallback)(function () {
|
|
54
|
+
var _config$handler;
|
|
55
|
+
|
|
56
|
+
(_config$handler = config.handler) === null || _config$handler === void 0 ? void 0 : _config$handler.call(config, editor);
|
|
57
|
+
}, []);
|
|
58
|
+
(0, _react.useEffect)(function () {
|
|
59
|
+
editor.on(_events.EDITOR_STATE_CHANGE, setState);
|
|
60
|
+
}, []);
|
|
61
|
+
var itemClass = (0, _classnames["default"])(preCls + '-item', (_classNames = {}, _defineProperty(_classNames, preCls + '-item--active', (_config$active = config.active) === null || _config$active === void 0 ? void 0 : _config$active.call(config, state)), _defineProperty(_classNames, preCls + '-item--disabled', (_config$disabled = config.disabled) === null || _config$disabled === void 0 ? void 0 : _config$disabled.call(config, state)), _classNames));
|
|
62
|
+
|
|
63
|
+
if (config.renderMenu) {
|
|
64
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
65
|
+
className: itemClass
|
|
66
|
+
}, config.renderMenu(editor, config));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
70
|
+
overlay: config.title,
|
|
71
|
+
placement: "top"
|
|
72
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
73
|
+
className: itemClass,
|
|
74
|
+
onClick: handleClickItem
|
|
75
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
76
|
+
className: config === null || config === void 0 ? void 0 : config.icon
|
|
77
|
+
})));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function RichEditorToolBar(_ref2) {
|
|
81
|
+
var editor = _ref2.editor;
|
|
82
|
+
var toolbars = (0, _react.useMemo)(function () {
|
|
83
|
+
var res = [];
|
|
84
|
+
editor === null || editor === void 0 ? void 0 : editor.controllers.forEach(function (controller) {
|
|
85
|
+
if (Array.isArray(controller.toolbar)) {
|
|
86
|
+
res = res.concat(controller.toolbar);
|
|
87
|
+
} else {
|
|
88
|
+
controller.toolbar && res.push(controller.toolbar);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
return res;
|
|
92
|
+
}, [editor === null || editor === void 0 ? void 0 : editor.controllers]);
|
|
93
|
+
var handleMouseDown = (0, _react.useCallback)(function () {
|
|
94
|
+
editor === null || editor === void 0 ? void 0 : editor.emit(_events.TOOLBAR_MOUSE_DOWN);
|
|
95
|
+
}, [editor]);
|
|
96
|
+
if (!editor) return null;
|
|
97
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
98
|
+
className: preCls,
|
|
99
|
+
onMouseDown: handleMouseDown
|
|
100
|
+
}, toolbars.map(function (config) {
|
|
101
|
+
return /*#__PURE__*/_react["default"].createElement(MenuItem, {
|
|
102
|
+
editor: editor,
|
|
103
|
+
config: config
|
|
104
|
+
});
|
|
105
|
+
}));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
var _default = RichEditorToolBar;
|
|
109
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var result = {
|
|
8
|
+
mac: false,
|
|
9
|
+
ie: false,
|
|
10
|
+
ie_version: 0,
|
|
11
|
+
gecko: false,
|
|
12
|
+
chrome: false,
|
|
13
|
+
chrome_version: 0,
|
|
14
|
+
android: false,
|
|
15
|
+
ios: false,
|
|
16
|
+
webkit: false
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
if (typeof navigator !== 'undefined') {
|
|
20
|
+
var ieEdge = /Edge\/(\d+)/.exec(navigator.userAgent);
|
|
21
|
+
var ieUpTo10 = /MSIE \d/.test(navigator.userAgent);
|
|
22
|
+
var ie11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
|
|
23
|
+
result.mac = /Mac/.test(navigator.platform);
|
|
24
|
+
var ie = result.ie = !!(ieUpTo10 || ie11up || ieEdge);
|
|
25
|
+
result.ie_version = ieUpTo10 ? document.documentMode || 6 : ie11up ? +ie11up[1] : ieEdge ? +ieEdge[1] : null;
|
|
26
|
+
result.gecko = !ie && /gecko\/\d/i.test(navigator.userAgent);
|
|
27
|
+
result.chrome = !ie && /Chrome\//.test(navigator.userAgent);
|
|
28
|
+
result.chrome_version = parseInt((navigator.userAgent.match(/Chrome\/(\d{2})/) || [])[1], 10);
|
|
29
|
+
result.android = /Android \d/.test(navigator.userAgent);
|
|
30
|
+
result.ios = !ie && /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent);
|
|
31
|
+
result.webkit = !ie && !!document.documentElement && 'WebkitAppearance' in document.documentElement.style;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
var _default = result;
|
|
35
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.chainTransactions = chainTransactions;
|
|
7
|
+
exports.filter = exports.clearNodes = void 0;
|
|
8
|
+
exports.findCutBefore = findCutBefore;
|
|
9
|
+
exports.selectNode = exports.isFirstChildOfParent = exports.isEmptySelectionAtStart = exports.isEmptySelectionAtEnd = exports.insertContentDeleteRange = void 0;
|
|
10
|
+
exports.setAlignment = setAlignment;
|
|
11
|
+
exports.setHeadLine = setHeadLine;
|
|
12
|
+
exports.walkPrevNode = exports.walkNextNode = void 0;
|
|
13
|
+
|
|
14
|
+
var _prosemirrorCommands = require("prosemirror-commands");
|
|
15
|
+
|
|
16
|
+
var _prosemirrorState = require("prosemirror-state");
|
|
17
|
+
|
|
18
|
+
var _prosemirrorTransform = require("prosemirror-transform");
|
|
19
|
+
|
|
20
|
+
var _schemas = _interopRequireDefault(require("../schemas"));
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
+
|
|
24
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
25
|
+
|
|
26
|
+
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."); }
|
|
27
|
+
|
|
28
|
+
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); }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
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; }
|
|
33
|
+
|
|
34
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
35
|
+
|
|
36
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
37
|
+
|
|
38
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
39
|
+
|
|
40
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
41
|
+
|
|
42
|
+
function chainTransactions() {
|
|
43
|
+
for (var _len = arguments.length, commands = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
44
|
+
commands[_key] = arguments[_key];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return function (state, dispatch) {
|
|
48
|
+
var dispatcher = function dispatcher(tr) {
|
|
49
|
+
state = state.apply(tr);
|
|
50
|
+
dispatch(tr);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
var last = commands.pop();
|
|
54
|
+
var reduced = commands.reduce(function (result, command) {
|
|
55
|
+
return result || command(state, dispatcher);
|
|
56
|
+
}, false);
|
|
57
|
+
return reduced && last !== undefined && last(state, dispatch);
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function setHeadLine(state, dispatchTransiction, level) {
|
|
62
|
+
var $from = state.selection.$from;
|
|
63
|
+
var node = $from.node();
|
|
64
|
+
|
|
65
|
+
if (node.type === _schemas["default"].nodes.heading && level === node.attrs.level) {
|
|
66
|
+
return (0, _prosemirrorCommands.setBlockType)(_schemas["default"].nodes.paragraph, node.attrs)(state, dispatchTransiction);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return chainTransactions(clearNodes(), (0, _prosemirrorCommands.setBlockType)(_schemas["default"].nodes.heading, _objectSpread(_objectSpread({}, node.attrs), {}, {
|
|
70
|
+
level: level
|
|
71
|
+
})))(state, dispatchTransiction);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function setAlignment(state, dispatchTransiction, alignment) {
|
|
75
|
+
var $from = state.selection.$from;
|
|
76
|
+
var node = $from.node();
|
|
77
|
+
return (0, _prosemirrorCommands.setBlockType)(node.type, _objectSpread(_objectSpread({}, node.attrs), {}, {
|
|
78
|
+
textAlign: alignment
|
|
79
|
+
}))(state, dispatchTransiction);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
var clearNodes = function clearNodes() {
|
|
83
|
+
return function (state, dispatch) {
|
|
84
|
+
var tr = state.tr;
|
|
85
|
+
var selection = tr.selection;
|
|
86
|
+
var ranges = selection.ranges;
|
|
87
|
+
ranges.forEach(function (range) {
|
|
88
|
+
state.doc.nodesBetween(range.$from.pos, range.$to.pos, function (node, pos) {
|
|
89
|
+
if (node.type.isText) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
var $fromPos = tr.doc.resolve(tr.mapping.map(pos));
|
|
94
|
+
var $toPos = tr.doc.resolve(tr.mapping.map(pos + node.nodeSize));
|
|
95
|
+
var nodeRange = $fromPos.blockRange($toPos);
|
|
96
|
+
|
|
97
|
+
if (!nodeRange) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
var targetLiftDepth = (0, _prosemirrorTransform.liftTarget)(nodeRange);
|
|
102
|
+
|
|
103
|
+
if (node.type.isTextblock && dispatch) {
|
|
104
|
+
var _$fromPos$parent$cont = $fromPos.parent.contentMatchAt($fromPos.index()),
|
|
105
|
+
defaultType = _$fromPos$parent$cont.defaultType;
|
|
106
|
+
|
|
107
|
+
tr.setNodeMarkup(nodeRange.start, defaultType);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if ((targetLiftDepth || targetLiftDepth === 0) && dispatch) {
|
|
111
|
+
tr.lift(nodeRange, targetLiftDepth);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
tr.docChanged && dispatch(tr);
|
|
116
|
+
return true;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
exports.clearNodes = clearNodes;
|
|
121
|
+
|
|
122
|
+
var filter = function filter(predicates, cmd) {
|
|
123
|
+
return function (state, dispatch, view) {
|
|
124
|
+
if (!Array.isArray(predicates)) {
|
|
125
|
+
predicates = [predicates];
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (predicates.some(function (pred) {
|
|
129
|
+
return !pred(state, view);
|
|
130
|
+
})) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return cmd(state, dispatch, view) || false;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
exports.filter = filter;
|
|
139
|
+
|
|
140
|
+
var isFirstChildOfParent = function isFirstChildOfParent(state) {
|
|
141
|
+
var $from = state.selection.$from;
|
|
142
|
+
return $from.depth > 1 ? // ? (state.selection instanceof GapCursorSelection &&
|
|
143
|
+
// $from.parentOffset === 0) ||
|
|
144
|
+
$from.index($from.depth - 1) === 0 : true;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
exports.isFirstChildOfParent = isFirstChildOfParent;
|
|
148
|
+
|
|
149
|
+
function findCutBefore($pos) {
|
|
150
|
+
// parent is non-isolating, so we can look across this boundary
|
|
151
|
+
if (!$pos.parent.type.spec.isolating) {
|
|
152
|
+
// search up the tree from the pos's *parent*
|
|
153
|
+
for (var i = $pos.depth - 1; i >= 0; i--) {
|
|
154
|
+
// starting from the inner most node's parent, find out
|
|
155
|
+
// if we're not its first child
|
|
156
|
+
if ($pos.index(i) > 0) {
|
|
157
|
+
return $pos.doc.resolve($pos.before(i + 1));
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if ($pos.node(i).type.spec.isolating) {
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
var isEmptySelectionAtStart = function isEmptySelectionAtStart(state) {
|
|
170
|
+
var _state$selection = state.selection,
|
|
171
|
+
empty = _state$selection.empty,
|
|
172
|
+
$from = _state$selection.$from;
|
|
173
|
+
return empty && $from.parentOffset === 0;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
exports.isEmptySelectionAtStart = isEmptySelectionAtStart;
|
|
177
|
+
|
|
178
|
+
var isEmptySelectionAtEnd = function isEmptySelectionAtEnd(state) {
|
|
179
|
+
var _state$selection2 = state.selection,
|
|
180
|
+
empty = _state$selection2.empty,
|
|
181
|
+
$from = _state$selection2.$from;
|
|
182
|
+
return empty && $from.end() === $from.pos;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
exports.isEmptySelectionAtEnd = isEmptySelectionAtEnd;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Walk backwards from a position until we encounter the (inside) end of
|
|
189
|
+
* the previous node, or reach the start of the document.
|
|
190
|
+
*
|
|
191
|
+
* @param $startPos Position to start walking from.
|
|
192
|
+
*/
|
|
193
|
+
var walkPrevNode = function walkPrevNode($startPos) {
|
|
194
|
+
var $pos = $startPos;
|
|
195
|
+
|
|
196
|
+
while ($pos.pos > 0 && ($pos.pos === $startPos.pos || $pos.parentOffset < $pos.parent.nodeSize - 2)) {
|
|
197
|
+
$pos = $pos.doc.resolve($pos.pos - 1);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
return {
|
|
201
|
+
$pos: $pos,
|
|
202
|
+
foundNode: $pos.pos > 0
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
exports.walkPrevNode = walkPrevNode;
|
|
207
|
+
|
|
208
|
+
var walkNextNode = function walkNextNode($startPos) {
|
|
209
|
+
var $pos = $startPos; // invariant 1: don't walk past the end of the document
|
|
210
|
+
// invariant 2: we are at the beginning or
|
|
211
|
+
// we haven't walked to the start of *any* node
|
|
212
|
+
// parentOffset includes textOffset.
|
|
213
|
+
|
|
214
|
+
while ($pos.pos < $pos.doc.nodeSize - 2 && ($pos.pos === $startPos.pos || $pos.parentOffset > 0)) {
|
|
215
|
+
$pos = $pos.doc.resolve($pos.pos + 1);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
return {
|
|
219
|
+
$pos: $pos,
|
|
220
|
+
foundNode: $pos.pos < $pos.doc.nodeSize - 2
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
/**
|
|
224
|
+
* Insert content, delete a range and create a new selection
|
|
225
|
+
* This function automatically handles the mapping of positions for insertion and deletion.
|
|
226
|
+
* The new selection is handled as a function since it may not always be necessary to resolve a position to the transactions mapping
|
|
227
|
+
*
|
|
228
|
+
* @param getSelectionResolvedPos get the resolved position to create a new selection
|
|
229
|
+
* @param insertions content to insert at the specified position
|
|
230
|
+
* @param deletions the ranges to delete
|
|
231
|
+
*/
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
exports.walkNextNode = walkNextNode;
|
|
235
|
+
|
|
236
|
+
var insertContentDeleteRange = function insertContentDeleteRange(tr, getSelectionResolvedPos, insertions, deletions) {
|
|
237
|
+
insertions.forEach(function (contentInsert) {
|
|
238
|
+
var _contentInsert = _slicedToArray(contentInsert, 2),
|
|
239
|
+
content = _contentInsert[0],
|
|
240
|
+
pos = _contentInsert[1];
|
|
241
|
+
|
|
242
|
+
tr.insert(tr.mapping.map(pos), content);
|
|
243
|
+
});
|
|
244
|
+
deletions.forEach(function (deleteRange) {
|
|
245
|
+
var _deleteRange = _slicedToArray(deleteRange, 2),
|
|
246
|
+
firstPos = _deleteRange[0],
|
|
247
|
+
lastPos = _deleteRange[1];
|
|
248
|
+
|
|
249
|
+
tr["delete"](tr.mapping.map(firstPos), tr.mapping.map(lastPos));
|
|
250
|
+
});
|
|
251
|
+
tr.setSelection(new _prosemirrorState.TextSelection(getSelectionResolvedPos(tr)));
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
exports.insertContentDeleteRange = insertContentDeleteRange;
|
|
255
|
+
|
|
256
|
+
var selectNode = function selectNode(pos) {
|
|
257
|
+
return function (state, dispatch) {
|
|
258
|
+
if (dispatch) {
|
|
259
|
+
dispatch(state.tr.setSelection(new _prosemirrorState.NodeSelection(state.doc.resolve(pos))));
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return true;
|
|
263
|
+
};
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
exports.selectNode = selectNode;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.findFarthestParentNode = void 0;
|
|
7
|
+
exports.getNodesCount = getNodesCount;
|
|
8
|
+
exports.getStepRange = void 0;
|
|
9
|
+
exports.hasVisibleContent = hasVisibleContent;
|
|
10
|
+
exports.isEmptyDocument = isEmptyDocument;
|
|
11
|
+
exports.isEmptyParagraph = isEmptyParagraph;
|
|
12
|
+
exports.isNodeEmpty = isNodeEmpty;
|
|
13
|
+
exports.isSelectionEndOfParagraph = void 0;
|
|
14
|
+
exports.nodesBetweenChanged = nodesBetweenChanged;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Checks if node is an empty paragraph.
|
|
18
|
+
*/
|
|
19
|
+
function isEmptyParagraph(node) {
|
|
20
|
+
return !node || node.type.name === 'paragraph' && !node.textContent && !node.childCount;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Returns false if node contains only empty inline nodes and hardBreaks.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
function hasVisibleContent(node) {
|
|
28
|
+
var isInlineNodeHasVisibleContent = function isInlineNodeHasVisibleContent(inlineNode) {
|
|
29
|
+
return inlineNode.isText ? !!inlineNode.textContent.trim() : inlineNode.type.name !== 'hardBreak';
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
if (node.isInline) {
|
|
33
|
+
return isInlineNodeHasVisibleContent(node);
|
|
34
|
+
} else if (node.isBlock && (node.isLeaf || node.isAtom)) {
|
|
35
|
+
return true;
|
|
36
|
+
} else if (!node.childCount) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
for (var _index = 0; _index < node.childCount; _index++) {
|
|
41
|
+
var child = node.child(_index);
|
|
42
|
+
|
|
43
|
+
if (hasVisibleContent(child)) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Checks if a node has any content. Ignores node that only contain empty block nodes.
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
function isNodeEmpty(node) {
|
|
56
|
+
if (node && node.textContent) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (!node || !node.childCount || node.childCount === 1 && isEmptyParagraph(node.firstChild)) {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
var block = [];
|
|
65
|
+
var nonBlock = [];
|
|
66
|
+
node.forEach(function (child) {
|
|
67
|
+
child.isInline ? nonBlock.push(child) : block.push(child);
|
|
68
|
+
});
|
|
69
|
+
return !nonBlock.length && !block.filter(function (childNode) {
|
|
70
|
+
return !!childNode.childCount && !(childNode.childCount === 1 && isEmptyParagraph(childNode.firstChild)) || childNode.isAtom;
|
|
71
|
+
}).length;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Checks if a node looks like an empty document
|
|
75
|
+
*/
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
function isEmptyDocument(node) {
|
|
79
|
+
var nodeChild = node.content.firstChild;
|
|
80
|
+
|
|
81
|
+
if (node.childCount !== 1 || !nodeChild) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return nodeChild.type.name === 'paragraph' && !nodeChild.childCount && nodeChild.nodeSize === 2 && (!nodeChild.marks || nodeChild.marks.length === 0);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
var getStepRange = function getStepRange(transaction) {
|
|
89
|
+
var from = -1;
|
|
90
|
+
var to = -1;
|
|
91
|
+
transaction.steps.forEach(function (step) {
|
|
92
|
+
step.getMap().forEach(function (_oldStart, _oldEnd, newStart, newEnd) {
|
|
93
|
+
from = newStart < from || from === -1 ? newStart : from;
|
|
94
|
+
to = newEnd < to || to === -1 ? newEnd : to;
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
if (from !== -1) {
|
|
99
|
+
return {
|
|
100
|
+
from: from,
|
|
101
|
+
to: to
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return null;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Find the farthest node given a condition
|
|
109
|
+
* @param predicate Function to check the node
|
|
110
|
+
*/
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
exports.getStepRange = getStepRange;
|
|
114
|
+
|
|
115
|
+
var findFarthestParentNode = function findFarthestParentNode(predicate) {
|
|
116
|
+
return function ($pos) {
|
|
117
|
+
var candidate = null;
|
|
118
|
+
|
|
119
|
+
for (var i = $pos.depth; i > 0; i--) {
|
|
120
|
+
var _node = $pos.node(i);
|
|
121
|
+
|
|
122
|
+
if (predicate(_node)) {
|
|
123
|
+
candidate = {
|
|
124
|
+
pos: i > 0 ? $pos.before(i) : 0,
|
|
125
|
+
start: $pos.start(i),
|
|
126
|
+
depth: i,
|
|
127
|
+
node: _node
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return candidate;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
exports.findFarthestParentNode = findFarthestParentNode;
|
|
137
|
+
|
|
138
|
+
var isSelectionEndOfParagraph = function isSelectionEndOfParagraph(state) {
|
|
139
|
+
return state.selection.$to.parent.type === state.schema.nodes.paragraph && state.selection.$to.pos === state.doc.resolve(state.selection.$to.pos).end();
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
exports.isSelectionEndOfParagraph = isSelectionEndOfParagraph;
|
|
143
|
+
|
|
144
|
+
function nodesBetweenChanged(tr, f, startPos) {
|
|
145
|
+
var stepRange = getStepRange(tr);
|
|
146
|
+
|
|
147
|
+
if (!stepRange) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
tr.doc.nodesBetween(stepRange.from, stepRange.to, f, startPos);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function getNodesCount(node) {
|
|
155
|
+
var count = {};
|
|
156
|
+
node.nodesBetween(0, node.nodeSize - 2, function (node) {
|
|
157
|
+
count[node.type.name] = (count[node.type.name] || 0) + 1;
|
|
158
|
+
});
|
|
159
|
+
return count;
|
|
160
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.EventDispatcher = void 0;
|
|
7
|
+
exports.createDispatch = createDispatch;
|
|
8
|
+
|
|
9
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
10
|
+
|
|
11
|
+
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); } }
|
|
12
|
+
|
|
13
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
14
|
+
|
|
15
|
+
var EventDispatcher = /*#__PURE__*/function () {
|
|
16
|
+
function EventDispatcher() {
|
|
17
|
+
_classCallCheck(this, EventDispatcher);
|
|
18
|
+
|
|
19
|
+
this.listeners = {};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
_createClass(EventDispatcher, [{
|
|
23
|
+
key: "on",
|
|
24
|
+
value: function on(event, cb) {
|
|
25
|
+
if (!this.listeners[event]) {
|
|
26
|
+
this.listeners[event] = new Set();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
this.listeners[event].add(cb);
|
|
30
|
+
}
|
|
31
|
+
}, {
|
|
32
|
+
key: "off",
|
|
33
|
+
value: function off(event, cb) {
|
|
34
|
+
if (!this.listeners[event]) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (this.listeners[event].has(cb)) {
|
|
39
|
+
this.listeners[event]["delete"](cb);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}, {
|
|
43
|
+
key: "emit",
|
|
44
|
+
value: function emit(event, data) {
|
|
45
|
+
if (!this.listeners[event]) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
this.listeners[event].forEach(function (cb) {
|
|
50
|
+
return cb(data);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}, {
|
|
54
|
+
key: "destroy",
|
|
55
|
+
value: function destroy() {
|
|
56
|
+
this.listeners = {};
|
|
57
|
+
}
|
|
58
|
+
}]);
|
|
59
|
+
|
|
60
|
+
return EventDispatcher;
|
|
61
|
+
}();
|
|
62
|
+
/**
|
|
63
|
+
* Creates a dispatch function that can be called inside ProseMirror Plugin
|
|
64
|
+
* to notify listeners about that plugin's state change.
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
exports.EventDispatcher = EventDispatcher;
|
|
69
|
+
|
|
70
|
+
function createDispatch(eventDispatcher) {
|
|
71
|
+
return function (eventName, data) {
|
|
72
|
+
if (!eventName) {
|
|
73
|
+
throw new Error('event name is required!');
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
var event = typeof eventName === 'string' ? eventName : eventName.key;
|
|
77
|
+
eventDispatcher.emit(event, data);
|
|
78
|
+
};
|
|
79
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.shallowEqual = shallowEqual;
|
|
7
|
+
|
|
8
|
+
function shallowEqual() {
|
|
9
|
+
var obj1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
10
|
+
var obj2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
11
|
+
var keys1 = Object.keys(obj1);
|
|
12
|
+
var keys2 = Object.keys(obj2);
|
|
13
|
+
return keys1.length === keys2.length && keys1.reduce(function (acc, key) {
|
|
14
|
+
return acc && obj1[key] === obj2[key];
|
|
15
|
+
}, true);
|
|
16
|
+
}
|