@titaui/pc 1.10.6 → 1.10.7-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.
Files changed (288) hide show
  1. package/.eslintrc.js +2 -2
  2. package/.prettierignore +4 -4
  3. package/lib/components/book-demo/utils.js +4 -0
  4. package/lib/components/button/default-button/index.css +10 -4
  5. package/lib/components/button/default-button/index.js +13 -2
  6. package/lib/components/change-okr-modal/index.js +6 -2
  7. package/lib/components/checkbox/index.css +1 -0
  8. package/lib/components/communication/CommunicationRecord.js +16 -16
  9. package/lib/components/communication/index.css +16 -15
  10. package/lib/components/communication/index.js +23 -6
  11. package/lib/components/communication/style.js +4 -4
  12. package/lib/components/create-okr-modal/fields/o-new-name.js +31 -21
  13. package/lib/components/create-okr-modal/fields/okr-parent.js +1 -5
  14. package/lib/components/create-okr-modal/kr-items/krDatas.js +16 -16
  15. package/lib/components/{dynamic/components/dangerous-html → dangerous-html}/index.js +0 -0
  16. package/lib/components/dialog/index.css +4 -1
  17. package/lib/components/dialog/index.js +1 -1
  18. package/lib/components/dialog-confirm/index.css +1 -1
  19. package/lib/components/drawer-manager/index.js +6 -1
  20. package/lib/components/dynamic/components/first-level-tabs/index.css +12 -2
  21. package/lib/components/dynamic/components/first-level-tabs/index.js +19 -6
  22. package/lib/components/dynamic/components/obj-status/index.css +1 -0
  23. package/lib/components/dynamic/components/obj-status/utils.js +1 -1
  24. package/lib/components/dynamic/constant.js +12 -2
  25. package/lib/components/dynamic/dynamic-item/components/feed-operate/index.css +71 -0
  26. package/lib/components/dynamic/dynamic-item/components/feed-operate/index.js +112 -0
  27. package/lib/components/dynamic/dynamic-item/components/header/index.css +2 -1
  28. package/lib/components/dynamic/dynamic-item/components/header/index.js +2 -2
  29. package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/index.js +31 -0
  30. package/lib/components/dynamic/dynamic-item/dynamic-align/index.css +13 -7
  31. package/lib/components/dynamic/dynamic-item/dynamic-align/index.js +10 -4
  32. package/lib/components/dynamic/dynamic-item/dynamic-announcement/index.css +1 -1
  33. package/lib/components/dynamic/dynamic-item/dynamic-assessment/index.css +1 -1
  34. package/lib/components/dynamic/dynamic-item/dynamic-assessment/index.js +5 -3
  35. package/lib/components/dynamic/dynamic-item/dynamic-chart/index.css +4 -0
  36. package/lib/components/dynamic/dynamic-item/dynamic-chart/index.js +102 -0
  37. package/lib/components/dynamic/dynamic-item/dynamic-chart/utils.js +61 -0
  38. package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.css +12 -11
  39. package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +8 -5
  40. package/lib/components/dynamic/dynamic-item/dynamic-kr/index.css +2 -2
  41. package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +5 -3
  42. package/lib/components/dynamic/dynamic-item/{dynamic-share-to-dynamic → dynamic-learning}/img/dynamic-share-course.png +0 -0
  43. package/lib/components/dynamic/dynamic-item/{dynamic-share-to-dynamic → dynamic-learning}/img/jiantou-right@3x.png +0 -0
  44. package/lib/components/dynamic/dynamic-item/{dynamic-share-to-dynamic → dynamic-learning}/img/user-photo.png +0 -0
  45. package/lib/components/dynamic/dynamic-item/{dynamic-share-to-dynamic → dynamic-learning}/index.css +2 -2
  46. package/lib/components/dynamic/dynamic-item/{dynamic-share-to-dynamic → dynamic-learning}/index.js +6 -5
  47. package/lib/components/dynamic/dynamic-item/dynamic-milestone/constant.js +9 -2
  48. package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.css +2 -2
  49. package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +4 -2
  50. package/lib/components/dynamic/dynamic-item/dynamic-okrs-communication/index.css +1 -1
  51. package/lib/components/dynamic/dynamic-item/dynamic-plan-communication/index.css +1 -1
  52. package/lib/components/dynamic/dynamic-item/dynamic-progress/index.css +2 -6
  53. package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +8 -6
  54. package/lib/components/dynamic/dynamic-item/dynamic-project/index.css +2 -2
  55. package/lib/components/dynamic/dynamic-item/dynamic-project/index.js +3 -1
  56. package/lib/components/dynamic/dynamic-item/dynamic-relative/index.css +13 -7
  57. package/lib/components/dynamic/dynamic-item/dynamic-relative/index.js +42 -6
  58. package/lib/components/dynamic/dynamic-item/{dynamic-replay → dynamic-reply}/index.css +14 -30
  59. package/lib/components/dynamic/dynamic-item/{dynamic-replay → dynamic-reply}/index.js +1 -1
  60. package/lib/components/dynamic/dynamic-item/dynamic-report/index.css +1 -1
  61. package/lib/components/dynamic/dynamic-item/dynamic-report/index.js +12 -3
  62. package/lib/components/dynamic/dynamic-item/dynamic-reward/img/reward.png +0 -0
  63. package/lib/components/dynamic/dynamic-item/dynamic-reward/index.css +6 -1
  64. package/lib/components/dynamic/dynamic-item/dynamic-reward/index.js +18 -51
  65. package/lib/components/dynamic/dynamic-item/dynamic-reward/utils.js +28 -0
  66. package/lib/components/dynamic/dynamic-item/dynamic-share/index.css +6 -2
  67. package/lib/components/dynamic/dynamic-item/dynamic-share/index.js +55 -2
  68. package/lib/components/dynamic/dynamic-item/dynamic-task/index.css +2 -2
  69. package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +1 -1
  70. package/lib/components/dynamic/dynamic-item/index.css +58 -3
  71. package/lib/components/dynamic/dynamic-item/index.js +124 -23
  72. package/lib/components/dynamic/dynamic-like-ranking/item.js +1 -1
  73. package/lib/components/dynamic/dynamic-list/index.js +11 -2
  74. package/lib/components/dynamic/dynamic-topping/item.js +8 -4
  75. package/lib/components/dynamic/dynamic.js +5 -2
  76. package/lib/components/dynamic/img/dynamic-operate.png +0 -0
  77. package/lib/components/dynamic/img/dynamic-point.svg +13 -0
  78. package/lib/components/dynamic/img/dynamic-reward-hover.svg +1 -0
  79. package/lib/components/dynamic/img/dynamic-reward-normal.svg +1 -0
  80. package/lib/components/dynamic/online-broadcast/data.js +13 -1
  81. package/lib/components/e-status-dropdown/index.css +3 -0
  82. package/lib/components/e-status-dropdown/index.js +94 -0
  83. package/lib/components/edit-kr-wight/style/index.js +2 -2
  84. package/lib/components/file-list/components/single-file/index.css +6 -5
  85. package/lib/components/file-list/components/single-file/index.js +1 -1
  86. package/lib/components/file-list/index.css +1 -0
  87. package/lib/components/follower-visitor/index.js +6 -4
  88. package/lib/components/grid-layout/okr-progress/index.js +20 -30
  89. package/lib/components/help-card/image/not-try.png +0 -0
  90. package/lib/components/help-card/image/try.png +0 -0
  91. package/lib/components/help-card/index.css +31 -2
  92. package/lib/components/help-card/index.js +54 -17
  93. package/lib/components/invite-people/img/invite-people.svg +62 -0
  94. package/lib/components/invite-people/index.css +1 -1
  95. package/lib/components/mblog/index.js +14 -5
  96. package/lib/components/menus/export-modules/demo-menus/index.js +2 -2
  97. package/lib/components/menus/export-modules/demo-menus/menu-highlight.js +25 -1
  98. package/lib/components/menus/export-modules/demo-menus/menus.js +60 -11
  99. package/lib/components/menus/export-modules/manage-menus/constant.js +1 -1
  100. package/lib/components/menus/export-modules/manage-menus/index.css +3 -0
  101. package/lib/components/menus/images/okr-gongsi.svg +17 -0
  102. package/lib/components/nav-top/components/menu/index.css +24 -0
  103. package/lib/components/nav-top/components/menu/index.js +9 -1
  104. package/lib/components/nav-top/components/user-message/components/reply/index.js +9 -8
  105. package/lib/components/nav-top/components/user-message/components/reply/reply-item.js +15 -5
  106. package/lib/components/nav-top/components/user-message/index.css +4 -3
  107. package/lib/components/nav-top/components/user-message/index.js +33 -6
  108. package/lib/components/nav-top/request.apis.js +22 -8
  109. package/lib/components/nav-top/useGlobalValue.js +14 -0
  110. package/lib/components/okr-detail/components/header/o-score.js +4 -6
  111. package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.css +26 -12
  112. package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +10 -4
  113. package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-project.js +20 -7
  114. package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-task-level2.js +3 -1
  115. package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-task.js +27 -6
  116. package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/index.css +29 -10
  117. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +1 -1
  118. package/lib/components/okr-detail/e-list/index.js +70 -24
  119. package/lib/components/okr-detail/e-list/util.js +11 -2
  120. package/lib/components/okr-detail/index.js +2 -0
  121. package/lib/components/okr-detail/okr-list/index.js +1 -5
  122. package/lib/components/okr-flow/export-modal/index.js +3 -3
  123. package/lib/components/okr-flow/root-node/index.js +14 -1
  124. package/lib/components/okr-progress-detail/index.css +11 -10
  125. package/lib/components/okr-progress-detail/index.js +5 -1
  126. package/lib/components/okr-progress-detail/utils.js +4 -4
  127. package/lib/components/okr-progress-modal/helper.js +20 -27
  128. package/lib/components/okr-share/common-painter/openDataPainter.js +34 -27
  129. package/lib/components/okrcase-library/okrcases-components/submitOkr-dialog.js +40 -36
  130. package/lib/components/open-data-painter/index.js +5 -1
  131. package/lib/components/progress/circle-progress/index.js +1 -1
  132. package/lib/components/rich-editor/basic/schema.js +47 -0
  133. package/lib/components/rich-editor/consts/events.js +12 -0
  134. package/lib/components/rich-editor/enums.js +42 -0
  135. package/lib/components/rich-editor/index.js +58 -0
  136. package/lib/components/rich-editor/keymap.js +119 -0
  137. package/lib/components/rich-editor/keymaps/index.js +241 -0
  138. package/lib/components/rich-editor/models/controller.js +18 -0
  139. package/lib/components/rich-editor/models/editor.js +47 -0
  140. package/lib/components/rich-editor/models/plugin.js +20 -0
  141. package/lib/components/rich-editor/models/schema.js +121 -0
  142. package/lib/components/rich-editor/plugins/block/block-quote/commond.js +27 -0
  143. package/lib/components/rich-editor/plugins/block/block-quote/index.js +128 -0
  144. package/lib/components/rich-editor/plugins/block/heading/commonds.js +31 -0
  145. package/lib/components/rich-editor/plugins/block/heading/index.js +190 -0
  146. package/lib/components/rich-editor/plugins/block/index.js +57 -0
  147. package/lib/components/rich-editor/plugins/block/lists/actions/conversions.js +172 -0
  148. package/lib/components/rich-editor/plugins/block/lists/actions/indent-list-items-selected.js +163 -0
  149. package/lib/components/rich-editor/plugins/block/lists/actions/indent-list.js +59 -0
  150. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-forward.js +74 -0
  151. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/index.js +45 -0
  152. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +104 -0
  153. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +92 -0
  154. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +89 -0
  155. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/join-paragraph-with-list.js +48 -0
  156. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/join-sibling-list-items.js +61 -0
  157. package/lib/components/rich-editor/plugins/block/lists/actions/merge-lists.js +34 -0
  158. package/lib/components/rich-editor/plugins/block/lists/actions/outdent-list-items-selected.js +289 -0
  159. package/lib/components/rich-editor/plugins/block/lists/actions/wrap-and-join-lists.js +180 -0
  160. package/lib/components/rich-editor/plugins/block/lists/baseCommand.js +328 -0
  161. package/lib/components/rich-editor/plugins/block/lists/commond/indent-list.js +60 -0
  162. package/lib/components/rich-editor/plugins/block/lists/commond/index.js +396 -0
  163. package/lib/components/rich-editor/plugins/block/lists/commond/join-list-item-forward.js +45 -0
  164. package/lib/components/rich-editor/plugins/block/lists/commond/listBackspace.js +302 -0
  165. package/lib/components/rich-editor/plugins/block/lists/commond/outdent-list.js +43 -0
  166. package/lib/components/rich-editor/plugins/block/lists/index.js +224 -0
  167. package/lib/components/rich-editor/plugins/block/lists/messages.js +38 -0
  168. package/lib/components/rich-editor/plugins/block/lists/pm-plugins/input-rule.js +152 -0
  169. package/lib/components/rich-editor/plugins/block/lists/pm-plugins/keymap.js +33 -0
  170. package/lib/components/rich-editor/plugins/block/lists/pm-plugins/main.js +94 -0
  171. package/lib/components/rich-editor/plugins/block/lists/styles.js +15 -0
  172. package/lib/components/rich-editor/plugins/block/lists/transforms.js +347 -0
  173. package/lib/components/rich-editor/plugins/block/lists/utils/analytics.js +48 -0
  174. package/lib/components/rich-editor/plugins/block/lists/utils/find.js +126 -0
  175. package/lib/components/rich-editor/plugins/block/lists/utils/indentation.js +87 -0
  176. package/lib/components/rich-editor/plugins/block/lists/utils/node.js +144 -0
  177. package/lib/components/rich-editor/plugins/block/lists/utils/replace-content.js +31 -0
  178. package/lib/components/rich-editor/plugins/block/lists/utils/selection.js +201 -0
  179. package/lib/components/rich-editor/plugins/block/lists/utils.js +52 -0
  180. package/lib/components/rich-editor/plugins/block/paragraph/index.js +91 -0
  181. package/lib/components/rich-editor/plugins/core/index.js +90 -0
  182. package/lib/components/rich-editor/plugins/core/pm-plugins/focus-handler.js +67 -0
  183. package/lib/components/rich-editor/plugins/core/pm-plugins/keymap.js +29 -0
  184. package/lib/components/rich-editor/plugins/core/pm-plugins/reactNodeView.js +80 -0
  185. package/lib/components/rich-editor/plugins/extension/alignment/commond.js +24 -0
  186. package/lib/components/rich-editor/plugins/extension/alignment/index.js +113 -0
  187. package/lib/components/rich-editor/plugins/extension/alignment/utils.js +19 -0
  188. package/lib/components/rich-editor/plugins/extension/index.js +18 -0
  189. package/lib/components/rich-editor/plugins/extension/placeholder/index.js +126 -0
  190. package/lib/components/rich-editor/plugins/extension/placeholder/styles.js +19 -0
  191. package/lib/components/rich-editor/plugins/index.js +44 -0
  192. package/lib/components/rich-editor/plugins/inline/color/commond.js +128 -0
  193. package/lib/components/rich-editor/plugins/inline/color/consts.js +43 -0
  194. package/lib/components/rich-editor/plugins/inline/color/index.css +61 -0
  195. package/lib/components/rich-editor/plugins/inline/color/index.js +217 -0
  196. package/lib/components/rich-editor/plugins/inline/color/selector.js +252 -0
  197. package/lib/components/rich-editor/plugins/inline/color/util.js +25 -0
  198. package/lib/components/rich-editor/plugins/inline/delete-line/index.js +149 -0
  199. package/lib/components/rich-editor/plugins/inline/em/index.js +93 -0
  200. package/lib/components/rich-editor/plugins/inline/index.js +83 -0
  201. package/lib/components/rich-editor/plugins/inline/link/commands.js +256 -0
  202. package/lib/components/rich-editor/plugins/inline/link/index.js +149 -0
  203. package/lib/components/rich-editor/plugins/inline/link/pm-plugins/fake-cursor-for-toolbar.js +77 -0
  204. package/lib/components/rich-editor/plugins/inline/link/pm-plugins/main.js +293 -0
  205. package/lib/components/rich-editor/plugins/inline/link/ui/index.css +84 -0
  206. package/lib/components/rich-editor/plugins/inline/link/ui/linkEditor.js +150 -0
  207. package/lib/components/rich-editor/plugins/inline/link/ui/linkToolbar.js +101 -0
  208. package/lib/components/rich-editor/plugins/inline/link/ui/toolbarBtn.js +117 -0
  209. package/lib/components/rich-editor/plugins/inline/link/utils.js +33 -0
  210. package/lib/components/rich-editor/plugins/inline/strong/index.js +139 -0
  211. package/lib/components/rich-editor/plugins/inline/under-line/index.js +147 -0
  212. package/lib/components/rich-editor/plugins/util.js +284 -0
  213. package/lib/components/rich-editor/react/reactNodeView.js +383 -0
  214. package/lib/components/rich-editor/react/uiProvider.js +185 -0
  215. package/lib/components/rich-editor/schemas/basic.js +309 -0
  216. package/lib/components/rich-editor/schemas/index.js +19 -0
  217. package/lib/components/rich-editor/schemas/list.js +342 -0
  218. package/lib/components/rich-editor/types/commond.js +5 -0
  219. package/lib/components/rich-editor/types/index.js +18 -0
  220. package/lib/components/rich-editor/ui/Popup/index.js +247 -0
  221. package/lib/components/rich-editor/ui/Popup/utils.js +399 -0
  222. package/lib/components/rich-editor/ui/editor/index.css +178 -0
  223. package/lib/components/rich-editor/ui/editor/index.js +153 -0
  224. package/lib/components/rich-editor/ui/normal-toolbar/index.css +34 -0
  225. package/lib/components/rich-editor/ui/normal-toolbar/index.js +109 -0
  226. package/lib/components/rich-editor/utils/browser.js +35 -0
  227. package/lib/components/rich-editor/utils/commands.js +266 -0
  228. package/lib/components/rich-editor/utils/document.js +211 -0
  229. package/lib/components/rich-editor/utils/event.js +79 -0
  230. package/lib/components/rich-editor/utils/helpers.js +16 -0
  231. package/lib/components/rich-editor/utils/mark.js +168 -0
  232. package/lib/components/rich-editor/utils/slice.js +85 -0
  233. package/lib/components/rich-editor/utils/toolbar.js +228 -0
  234. package/lib/components/superset-charts/components/chart/index.js +54 -0
  235. package/lib/components/superset-charts/fetch-assets-and-append/append-assets.js +106 -0
  236. package/lib/components/superset-charts/fetch-assets-and-append/get-assets-with-cache.js +131 -0
  237. package/lib/components/superset-charts/fetch-assets-and-append/index.js +79 -0
  238. package/lib/components/superset-charts/index.js +13 -0
  239. package/lib/components/superset-charts/interface.js +5 -0
  240. package/lib/components/superset-charts/utils/axios.js +102 -0
  241. package/lib/components/toast/index.js +5 -17
  242. package/lib/components/tree/index.css +3 -2
  243. package/lib/components/upload/index.js +4 -2
  244. package/lib/components/upload/util.js +2 -0
  245. package/lib/components/upload-photo-modal/request-api.js +1 -17
  246. package/lib/components/user-selector/empty/index.css +6 -6
  247. package/lib/components/user-selector/selected-panel/index.css +3 -3
  248. package/lib/components/{float-fixed-video-modal → video-modal/components/video-box}/index.css +118 -121
  249. package/lib/components/{float-fixed-video-modal → video-modal/components/video-box}/index.js +182 -182
  250. package/lib/components/{float-fixed-video-modal → video-modal}/img/close.png +0 -0
  251. package/lib/components/{float-fixed-video-modal → video-modal}/img/full.svg +0 -0
  252. package/lib/components/video-modal/img/muted.svg +8 -10
  253. package/lib/components/video-modal/img/not-muted.svg +17 -11
  254. package/lib/components/video-modal/img/pause.svg +7 -11
  255. package/lib/components/video-modal/img/play.svg +13 -11
  256. package/lib/components/video-modal/index.css +38 -168
  257. package/lib/components/video-modal/index.js +104 -244
  258. package/lib/components/video-modal/utils.js +2 -2
  259. package/lib/components/weekly-report/common-painter/openDataPainter.js +5 -1
  260. package/lib/hooks/useGlobalState.js +63 -0
  261. package/lib/index.js +31 -7
  262. package/lib/pages/aha2021/img/canceled.svg +13 -0
  263. package/lib/pages/aha2021/img/not-try.png +0 -0
  264. package/lib/pages/aha2021/img/try.png +0 -0
  265. package/lib/pages/aha2021/index.css +52 -0
  266. package/lib/pages/aha2021/index.js +73 -14
  267. package/lib/pages/new-okr-list/header/index.js +2 -1
  268. package/lib/pages/new-okr-list/index.js +3 -3
  269. package/lib/pages/okr-map/export-modules/share-okr-page/header/index.js +0 -5
  270. package/lib/pages/pay/image/success.png +0 -0
  271. package/lib/pages/pay/index.css +79 -0
  272. package/lib/pages/pay/index.js +66 -0
  273. package/lib/pages/personal-info/request-api.js +1 -1
  274. package/lib/utils/auth.js +15 -5
  275. package/lib/utils/bs-global.js +8 -8
  276. package/lib/utils/helpers.js +7 -1
  277. package/lib/utils/open-data.js +82 -2
  278. package/lib/utils/tools.js +11 -2
  279. package/package.json +120 -101
  280. package/lib/components/float-fixed-video-modal/img/muted.svg +0 -21
  281. package/lib/components/float-fixed-video-modal/img/pause.svg +0 -21
  282. package/lib/components/float-fixed-video-modal/img/play.svg +0 -22
  283. package/lib/components/float-fixed-video-modal/img/small.svg +0 -22
  284. package/lib/components/float-fixed-video-modal/img/smallFaQi.png +0 -0
  285. package/lib/components/float-fixed-video-modal/img/volume.svg +0 -21
  286. package/lib/components/float-fixed-video-modal/utils.js +0 -25
  287. package/lib/components/invite-people/img/invite-people.png +0 -0
  288. package/lib/components/video-modal/img/play.png +0 -0
@@ -28,38 +28,31 @@ var getOSetting = function getOSetting() {
28
28
  key: 2,
29
29
  tooltip: (0, _getLocale.getLocale)("OKR_MyO_Pop_Upd_SubO")
30
30
  }],
31
- getRecommandText: function getRecommandText(recommandProgressObj) {
32
- var autoUpdate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
33
- var updateWay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
31
+ getRecommandText: function getRecommandText() {
32
+ var autoUpdate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
33
+ var updateWay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
34
+ var recommandProgressObj = arguments.length > 2 ? arguments[2] : undefined;
34
35
 
35
36
  if (autoUpdate) {
36
- if (updateWay === 1) return /*#__PURE__*/_react["default"].createElement("span", {
37
+ if (updateWay == 1) return /*#__PURE__*/_react["default"].createElement("span", {
37
38
  className: "auto-update__recommand-tip"
38
- }, (0, _getLocale.getLocale)("OKR_MyO_Pop_Upd_Automatic"));
39
- if (updateWay === 2) return /*#__PURE__*/_react["default"].createElement("span", {
39
+ }, (0, _getLocale.getLocale)('OKR_MyO_Pop_Upd_Automatic'));
40
+ if (updateWay == 2) return /*#__PURE__*/_react["default"].createElement("span", {
40
41
  className: "auto-update__recommand-tip"
41
- }, (0, _getLocale.getLocale)("OKR_MyO_calculationSubO"));
42
- return /*#__PURE__*/_react["default"].createElement("span", null);
43
- }
44
-
45
- var childOkrProgress = recommandProgressObj.childOkrProgress,
46
- childkrProgress = recommandProgressObj.childkrProgress;
47
- var textArr = [];
48
-
49
- if (childkrProgress !== -1) {
50
- textArr.push("".concat((0, _getLocale.getLocale)("OKR_MyO_Pop_Upd_KRCom")).concat(childkrProgress).concat((0, _getLocale.getLocale)("OKR_MyO_Pop_Upd_Percentage")));
51
- }
52
-
53
- if (childOkrProgress !== -1) {
54
- textArr.push("".concat((0, _getLocale.getLocale)("OKR_MyO_Ew_SubobjCom")).concat(childOkrProgress).concat((0, _getLocale.getLocale)("OKR_MyO_Pop_Upd_Percentage")));
42
+ }, (0, _getLocale.getLocale)('OKR_MyO_calculationSubO'));
43
+ } else {
44
+ var childOkrProgress = recommandProgressObj.childOkrProgress,
45
+ childkrProgress = recommandProgressObj.childkrProgress;
46
+ var textArr = [];
47
+ childkrProgress !== -1 && textArr.push("KR\u5B8C\u6210\u5EA6".concat(childkrProgress, "%"));
48
+ childOkrProgress !== -1 && textArr.push("".concat((0, _getLocale.getLocale)('OKR_MyO_Ew_SubobjCom')).concat(childOkrProgress, "%"));
49
+ if (textArr.length == 0) return '';
50
+ return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("span", {
51
+ className: "auto-update__recommand-icon"
52
+ }, (0, _getLocale.getLocale)('Per_Ass_Pop_title_Recommend')), /*#__PURE__*/_react["default"].createElement("span", {
53
+ className: "auto-update__recommand-tip"
54
+ }, "\uFF08", textArr.join(','), "\uFF09"));
55
55
  }
56
-
57
- if (textArr.length === 0) return "";
58
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("span", {
59
- className: "auto-update__recommand-icon"
60
- }, (0, _getLocale.getLocale)("Per_Ass_Pop_title_Recommend")), /*#__PURE__*/_react["default"].createElement("span", {
61
- className: "auto-update__recommand-tip"
62
- }, "\uFF08", textArr.join(","), "\uFF09"));
63
56
  }
64
57
  };
65
58
  };
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = _default;
6
+ exports["default"] = void 0;
7
7
 
8
8
  var _openData = require("../../../utils/open-data");
9
9
 
@@ -13,12 +13,38 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
13
13
 
14
14
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
15
15
 
16
- function _default(_x, _x2, _x3) {
17
- return _ref.apply(this, arguments);
16
+ var getOpenData = function getOpenData(_ref) {
17
+ var id = _ref.id,
18
+ name = _ref.name,
19
+ type = _ref.type;
20
+ var openId = (0, _openData.getOpenId)(id, type);
21
+ if (!window.WWOpenData || !openId) return Promise.resolve(name);
22
+ return new Promise(function (resolve, reject) {
23
+ window.WWOpenData.prefetch({
24
+ items: [{
25
+ id: openId,
26
+ type: type
27
+ }]
28
+ }, function (err, data) {
29
+ if (err) {
30
+ return reject(err);
31
+ }
32
+
33
+ if (data && data.items[0]) {
34
+ resolve(data.items[0].data);
35
+ } else {
36
+ resolve(name);
37
+ }
38
+ });
39
+ });
40
+ };
41
+
42
+ function openDataPainter(_x, _x2, _x3) {
43
+ return _openDataPainter.apply(this, arguments);
18
44
  }
19
45
 
20
- function _ref() {
21
- _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(ctx, openDataParams, lineHeight) {
46
+ function _openDataPainter() {
47
+ _openDataPainter = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(ctx, openDataParams, lineHeight) {
22
48
  var maxWidth,
23
49
  name,
24
50
  _ctx$measureText,
@@ -69,27 +95,8 @@ function _ref() {
69
95
  }
70
96
  }, _callee);
71
97
  }));
72
- return _ref.apply(this, arguments);
98
+ return _openDataPainter.apply(this, arguments);
73
99
  }
74
100
 
75
- var getOpenData = function getOpenData(_ref2) {
76
- var id = _ref2.id,
77
- name = _ref2.name,
78
- type = _ref2.type;
79
- var openId = (0, _openData.getOpenId)(id, type);
80
- if (!window.WWOpenData || !openId) return Promise.resolve(name);
81
- return new Promise(function (resolve, reject) {
82
- window.WWOpenData.prefetch({
83
- items: [{
84
- id: openId,
85
- type: type
86
- }]
87
- }, function (err, data) {
88
- if (err) {
89
- return reject(err);
90
- }
91
-
92
- resolve(data.items[0].data);
93
- });
94
- });
95
- };
101
+ var _default = openDataPainter;
102
+ exports["default"] = _default;
@@ -57,23 +57,23 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
57
57
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
58
58
 
59
59
  var Fields = _form["default"].Fields;
60
- var precls = 'okr-cases-library__pay-window';
60
+ var precls = "okr-cases-library__pay-window";
61
61
 
62
62
  function SubmitDialog(props) {
63
63
  var handleShowSubmitOkrWindow = props.handleShowSubmitOkrWindow,
64
64
  isShowSubmitOkrWindow = props.isShowSubmitOkrWindow;
65
65
 
66
- var _useState = (0, _react.useState)(''),
66
+ var _useState = (0, _react.useState)(""),
67
67
  _useState2 = _slicedToArray(_useState, 2),
68
68
  type = _useState2[0],
69
69
  setType = _useState2[1];
70
70
 
71
- var _useState3 = (0, _react.useState)(''),
71
+ var _useState3 = (0, _react.useState)(""),
72
72
  _useState4 = _slicedToArray(_useState3, 2),
73
73
  job = _useState4[0],
74
74
  setJob = _useState4[1];
75
75
 
76
- var _useState5 = (0, _react.useState)(''),
76
+ var _useState5 = (0, _react.useState)(""),
77
77
  _useState6 = _slicedToArray(_useState5, 2),
78
78
  scene = _useState6[0],
79
79
  setScene = _useState6[1];
@@ -93,11 +93,11 @@ function SubmitDialog(props) {
93
93
 
94
94
  if (!err.length) {
95
95
  (0, _network.postSurvey)(body).then(function () {
96
- _toast["default"].Success('发送成功');
96
+ _toast["default"].Success("发送成功");
97
97
 
98
98
  handleShowSubmitOkrWindow(false);
99
99
  })["catch"](function () {
100
- _toast["default"].Warning('发送失败');
100
+ _toast["default"].Warning("发送失败");
101
101
  });
102
102
  }
103
103
  };
@@ -130,7 +130,7 @@ function SubmitDialog(props) {
130
130
  placeholder: "\u5982\u9500\u552E\u56E2\u961F",
131
131
  require: true,
132
132
  verifies: [{
133
- tip: 'OKR类型不能为空',
133
+ tip: "OKR类型不能为空",
134
134
  test: /\S/
135
135
  }],
136
136
  onChange: setType
@@ -140,7 +140,7 @@ function SubmitDialog(props) {
140
140
  placeholder: "\u5982\u9500\u552EVP",
141
141
  require: true,
142
142
  verifies: [{
143
- tip: 'OKR岗位不能为空',
143
+ tip: "OKR岗位不能为空",
144
144
  test: /\S/
145
145
  }],
146
146
  onChange: setJob
@@ -155,7 +155,7 @@ function SubmitDialog(props) {
155
155
  })), /*#__PURE__*/_react["default"].createElement("div", {
156
156
  className: "okr-cases-library__submitWindow-submitButton",
157
157
  onClick: onSubmitButtonClick
158
- }, (0, _getLocale.getLocale)('Pro_detail_Submission'))));
158
+ }, (0, _getLocale.getLocale)("Pro_detail_Submission"))));
159
159
  }
160
160
 
161
161
  function PayDialog(props) {
@@ -176,38 +176,38 @@ function PayDialog(props) {
176
176
  var tenantType = window.BSGlobal.tenantInfo.tenantType; // 外部注冊賬號使用的產品ID不同
177
177
 
178
178
  // 外部注冊賬號使用的產品ID不同
179
- if (Version === 1 && tenantType === 3) return 'D9E059E4-4303-4EE2-9275-AE2FA74BBAA6';
180
- return '60AFAD35-5273-4A06-B2F4-9A3193096BE7';
179
+ if (Version === 1 && tenantType === 3) return "D9E059E4-4303-4EE2-9275-AE2FA74BBAA6";
180
+ return "60AFAD35-5273-4A06-B2F4-9A3193096BE7";
181
181
  }),
182
182
  _useState10 = _slicedToArray(_useState9, 1),
183
183
  packageId = _useState10[0];
184
184
 
185
- var _useState11 = (0, _react.useState)(''),
185
+ var _useState11 = (0, _react.useState)(""),
186
186
  _useState12 = _slicedToArray(_useState11, 2),
187
187
  orderId = _useState12[0],
188
188
  setOrderId = _useState12[1];
189
189
 
190
- var _useState13 = (0, _react.useState)('wxPay'),
190
+ var _useState13 = (0, _react.useState)("wxPay"),
191
191
  _useState14 = _slicedToArray(_useState13, 2),
192
192
  payCode = _useState14[0],
193
193
  setPayCode = _useState14[1];
194
194
 
195
- var _useState15 = (0, _react.useState)('微信'),
195
+ var _useState15 = (0, _react.useState)("微信"),
196
196
  _useState16 = _slicedToArray(_useState15, 2),
197
197
  payName = _useState16[0],
198
198
  setPayName = _useState16[1];
199
199
 
200
200
  var _useState17 = (0, _react.useState)({
201
- PayCode: 'directPay',
202
- PayName: '支付宝'
201
+ PayCode: "directPay",
202
+ PayName: "支付宝"
203
203
  }),
204
204
  _useState18 = _slicedToArray(_useState17, 2),
205
205
  wxModel = _useState18[0],
206
206
  setWxModel = _useState18[1];
207
207
 
208
208
  var _useState19 = (0, _react.useState)({
209
- PayCode: 'wxPay',
210
- PayName: '微信'
209
+ PayCode: "wxPay",
210
+ PayName: "微信"
211
211
  }),
212
212
  _useState20 = _slicedToArray(_useState19, 2),
213
213
  aliModel = _useState20[0],
@@ -259,9 +259,9 @@ function PayDialog(props) {
259
259
  } else {
260
260
  // 订单已支付
261
261
  _titaUi.Modal.success({
262
- title: '支付成功',
263
- content: 'OKR案例库已开通',
264
- okText: '立即使用',
262
+ title: "支付成功",
263
+ content: "OKR案例库已开通",
264
+ okText: "立即使用",
265
265
  onOk: function () {
266
266
  var _onOk = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
267
267
  return regeneratorRuntime.wrap(function _callee$(_context) {
@@ -300,15 +300,17 @@ function PayDialog(props) {
300
300
  };
301
301
 
302
302
  var clickPayNowHandler = function clickPayNowHandler(e) {
303
- if (payCode == 'wxPay') {
303
+ if (payCode === "wxPay") {
304
304
  e.preventDefault();
305
- (0, _network.postWxPayOrder)({
306
- order_id: orderId,
307
- default_bank: payCode,
308
- default_bank_name: payName
309
- }).then(function (res) {
310
- window.open(res, '_blank');
311
- });
305
+ var path = window.location.href.split("#")[0];
306
+ var encode = encodeURIComponent("orderId=".concat(orderId, "&payCode=").concat(payCode, "&payName=").concat(payName));
307
+ window.open("".concat(path, "#/pay?").concat(encode), "_blank"); // postWxPayOrder({
308
+ // order_id: orderId,
309
+ // default_bank: payCode,
310
+ // default_bank_name: payName,
311
+ // }).then((res) => {
312
+ // window.open(res, '_blank')
313
+ // })
312
314
  }
313
315
 
314
316
  loopOrderInfo(orderId);
@@ -335,43 +337,45 @@ function PayDialog(props) {
335
337
  return handleShowPayWindow(false);
336
338
  },
337
339
  style: {
338
- width: '18px',
339
- height: '18px'
340
+ width: "18px",
341
+ height: "18px"
340
342
  }
341
343
  }), /*#__PURE__*/_react["default"].createElement("p", {
342
344
  className: "".concat(precls, "__head")
343
- }, price, " \u8D2D\u4E70\u5343\u4EFD OKR \u6848\u4F8B\u5E93"), /*#__PURE__*/_react["default"].createElement("p", {
345
+ }, price, " ", "\u8D2D\u4E70\u5343\u4EFD OKR \u6848\u4F8B\u5E93"), /*#__PURE__*/_react["default"].createElement("p", {
344
346
  className: "".concat(precls, "__detail")
345
347
  }, "\u53EF\u67E5\u770B \u4F7F\u7528\u6848\u4F8B\u5E93\u6240\u6709\u884C\u4E1A\u7684\u6848\u4F8B", /*#__PURE__*/_react["default"].createElement("a", {
346
348
  href: "https://club.tita.com/okr-examples",
347
349
  target: "_blank",
348
350
  rel: "noreferrer"
349
- }, (0, _getLocale.getLocale)('Mod_Checkdetails'))), /*#__PURE__*/_react["default"].createElement("div", {
351
+ }, (0, _getLocale.getLocale)("Mod_Checkdetails"))), /*#__PURE__*/_react["default"].createElement("div", {
350
352
  className: "".concat(precls, "__amount")
351
353
  }, "\u5E94\u4ED8\u91D1\u989D\uFF1A", /*#__PURE__*/_react["default"].createElement("b", null, /*#__PURE__*/_react["default"].createElement("span", {
352
354
  style: {
353
- fontSize: '32px'
355
+ fontSize: "32px"
354
356
  }
355
357
  }, "29.8"), "\u5143/\u5E74")), /*#__PURE__*/_react["default"].createElement("div", {
356
358
  className: "".concat(precls, "__type")
357
359
  }, /*#__PURE__*/_react["default"].createElement("div", {
358
- className: (0, _classnames["default"])("".concat(precls, "__commit-order"), "".concat(precls, "__commit-order--wx"), _defineProperty({}, "".concat(precls, "__commit-order--active"), payCode == (wxModel === null || wxModel === void 0 ? void 0 : wxModel.PayCode))),
360
+ className: (0, _classnames["default"])("".concat(precls, "__commit-order"), "".concat(precls, "__commit-order--wx"), _defineProperty({}, "".concat(precls, "__commit-order--active"), payCode === (wxModel === null || wxModel === void 0 ? void 0 : wxModel.PayCode))),
359
361
  onClick: function onClick() {
360
362
  return onPayOrderChange(wxModel);
361
363
  }
362
364
  }, /*#__PURE__*/_react["default"].createElement("img", {
363
365
  src: _wxPay["default"],
366
+ alt: "",
364
367
  width: 20,
365
368
  style: {
366
369
  marginRight: 4
367
370
  }
368
371
  }), "\u5FAE\u4FE1\u652F\u4ED8"), /*#__PURE__*/_react["default"].createElement("div", {
369
- className: (0, _classnames["default"])("".concat(precls, "__commit-order"), _defineProperty({}, "".concat(precls, "__commit-order--active"), payCode == (aliModel === null || aliModel === void 0 ? void 0 : aliModel.PayCode))),
372
+ className: (0, _classnames["default"])("".concat(precls, "__commit-order"), _defineProperty({}, "".concat(precls, "__commit-order--active"), payCode === (aliModel === null || aliModel === void 0 ? void 0 : aliModel.PayCode))),
370
373
  onClick: function onClick() {
371
374
  return onPayOrderChange(aliModel);
372
375
  }
373
376
  }, /*#__PURE__*/_react["default"].createElement("img", {
374
377
  src: _aliPay["default"],
378
+ alt: "",
375
379
  width: 20,
376
380
  style: {
377
381
  marginRight: 4
@@ -90,7 +90,11 @@ var getOpenData = function getOpenData(_ref2) {
90
90
  return reject(err);
91
91
  }
92
92
 
93
- resolve(data.items[0].data);
93
+ if (data && data.items[0]) {
94
+ resolve(data.items[0].data);
95
+ } else {
96
+ resolve(name);
97
+ }
94
98
  });
95
99
  });
96
100
  };
@@ -19,7 +19,7 @@ function CircleProgress(props) {
19
19
  _props$color = props.color,
20
20
  color = _props$color === void 0 ? "#419BFF" : _props$color,
21
21
  _props$percent = props.percent,
22
- percent = _props$percent === void 0 ? 10 : _props$percent,
22
+ percent = _props$percent === void 0 ? 0 : _props$percent,
23
23
  _props$width = props.width,
24
24
  width = _props$width === void 0 ? 8 : _props$width,
25
25
  _props$backgroundColo = props.backgroundColor,
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var basicSchema = {
8
+ nodes: {
9
+ doc: {
10
+ content: "block+"
11
+ },
12
+ text: {
13
+ group: "inline"
14
+ },
15
+ hard_break: {
16
+ inline: true,
17
+ group: "inline",
18
+ selectable: false,
19
+ parseDOM: [{
20
+ tag: "br"
21
+ }],
22
+ toDOM: function toDOM() {
23
+ return ["br"];
24
+ }
25
+ },
26
+ paragraph: {
27
+ content: "inline*",
28
+ attrs: {
29
+ textAlign: {
30
+ "default": 'left'
31
+ }
32
+ },
33
+ group: "block",
34
+ parseDOM: [{
35
+ tag: "p"
36
+ }],
37
+ toDOM: function toDOM(node) {
38
+ return ["p", {
39
+ style: "text-align:".concat(node.attrs["textAlign"])
40
+ }, 0];
41
+ }
42
+ }
43
+ },
44
+ marks: {}
45
+ };
46
+ var _default = basicSchema;
47
+ exports["default"] = _default;
@@ -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
+ }