@hailin-zheng/editor-core 1.0.4 → 1.0.7

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 (302) hide show
  1. package/{dist → lib}/doc-ruler.d.ts +0 -0
  2. package/{dist → lib}/doc-ruler.js +0 -0
  3. package/{dist → lib}/doc-ruler.js.map +0 -0
  4. package/{dist → lib}/framework/common-util.d.ts +0 -0
  5. package/{dist → lib}/framework/common-util.js +0 -0
  6. package/{dist → lib}/framework/common-util.js.map +0 -0
  7. package/{dist → lib}/framework/document-change.d.ts +0 -0
  8. package/{dist → lib}/framework/document-change.js +0 -0
  9. package/{dist → lib}/framework/document-change.js.map +0 -0
  10. package/{dist → lib}/framework/document-combine.d.ts +0 -0
  11. package/{dist → lib}/framework/document-combine.js +0 -0
  12. package/{dist → lib}/framework/document-combine.js.map +0 -0
  13. package/{dist → lib}/framework/document-comment.d.ts +0 -0
  14. package/{dist → lib}/framework/document-comment.js +0 -0
  15. package/{dist → lib}/framework/document-comment.js.map +0 -0
  16. package/{dist → lib}/framework/document-context.d.ts +0 -0
  17. package/{dist → lib}/framework/document-context.js +0 -0
  18. package/{dist → lib}/framework/document-context.js.map +0 -0
  19. package/{dist → lib}/framework/document-eval-func.d.ts +0 -0
  20. package/{dist → lib}/framework/document-eval-func.js +0 -0
  21. package/{dist → lib}/framework/document-eval-func.js.map +0 -0
  22. package/{dist → lib}/framework/document-event.d.ts +0 -0
  23. package/{dist → lib}/framework/document-event.js +0 -0
  24. package/{dist → lib}/framework/document-event.js.map +0 -0
  25. package/{dist → lib}/framework/document-history.d.ts +0 -0
  26. package/{dist → lib}/framework/document-history.js +0 -0
  27. package/{dist → lib}/framework/document-history.js.map +0 -0
  28. package/{dist → lib}/framework/document-images-loader.d.ts +0 -0
  29. package/{dist → lib}/framework/document-images-loader.js +0 -0
  30. package/{dist → lib}/framework/document-images-loader.js.map +0 -0
  31. package/{dist → lib}/framework/document-input-cursor.d.ts +0 -0
  32. package/{dist → lib}/framework/document-input-cursor.js +0 -0
  33. package/{dist → lib}/framework/document-input-cursor.js.map +0 -0
  34. package/{dist → lib}/framework/document-paint.d.ts +0 -0
  35. package/{dist → lib}/framework/document-paint.js +0 -0
  36. package/{dist → lib}/framework/document-paint.js.map +0 -0
  37. package/{dist → lib}/framework/document-print-offscreen.d.ts +0 -0
  38. package/{dist → lib}/framework/document-print-offscreen.js +0 -0
  39. package/{dist → lib}/framework/document-print-offscreen.js.map +0 -0
  40. package/{dist → lib}/framework/document-print.d.ts +0 -0
  41. package/{dist → lib}/framework/document-print.js +0 -0
  42. package/{dist → lib}/framework/document-print.js.map +0 -0
  43. package/{dist → lib}/framework/document-segmenter.d.ts +0 -0
  44. package/{dist → lib}/framework/document-segmenter.js +0 -0
  45. package/{dist → lib}/framework/document-segmenter.js.map +0 -0
  46. package/{dist → lib}/framework/document-selection.d.ts +0 -0
  47. package/{dist → lib}/framework/document-selection.js +0 -0
  48. package/{dist → lib}/framework/document-selection.js.map +0 -0
  49. package/{dist → lib}/framework/document-template.d.ts +0 -0
  50. package/{dist → lib}/framework/document-template.js +0 -0
  51. package/{dist → lib}/framework/document-template.js.map +0 -0
  52. package/{dist → lib}/framework/document-textline-mode.d.ts +0 -0
  53. package/{dist → lib}/framework/document-textline-mode.js +0 -0
  54. package/{dist → lib}/framework/document-textline-mode.js.map +0 -0
  55. package/{dist → lib}/framework/element-define.d.ts +0 -0
  56. package/{dist → lib}/framework/element-define.js +0 -0
  57. package/{dist → lib}/framework/element-define.js.map +0 -0
  58. package/{dist → lib}/framework/element-event-define.d.ts +0 -0
  59. package/{dist → lib}/framework/element-event-define.js +0 -0
  60. package/{dist → lib}/framework/element-event-define.js.map +0 -0
  61. package/{dist → lib}/framework/element-measure.d.ts +0 -0
  62. package/{dist → lib}/framework/element-measure.js +0 -0
  63. package/{dist → lib}/framework/element-measure.js.map +0 -0
  64. package/{dist → lib}/framework/element-paint.d.ts +0 -0
  65. package/{dist → lib}/framework/element-paint.js +0 -0
  66. package/{dist → lib}/framework/element-paint.js.map +0 -0
  67. package/{dist → lib}/framework/element-props.d.ts +0 -0
  68. package/{dist → lib}/framework/element-props.js +0 -0
  69. package/{dist → lib}/framework/element-props.js.map +0 -0
  70. package/{dist → lib}/framework/element-reader.d.ts +0 -0
  71. package/{dist → lib}/framework/element-reader.js +0 -0
  72. package/{dist → lib}/framework/element-reader.js.map +0 -0
  73. package/{dist → lib}/framework/element-render-cut.d.ts +0 -0
  74. package/{dist → lib}/framework/element-render-cut.js +0 -0
  75. package/{dist → lib}/framework/element-render-cut.js.map +0 -0
  76. package/{dist → lib}/framework/element-serialize.d.ts +0 -0
  77. package/{dist → lib}/framework/element-serialize.js +0 -0
  78. package/{dist → lib}/framework/element-serialize.js.map +0 -0
  79. package/{dist → lib}/framework/element-util.d.ts +0 -0
  80. package/{dist → lib}/framework/element-util.js +0 -0
  81. package/{dist → lib}/framework/element-util.js.map +0 -0
  82. package/{dist → lib}/framework/impl/checkbox/checkbox-impl.d.ts +0 -0
  83. package/{dist → lib}/framework/impl/checkbox/checkbox-impl.js +0 -0
  84. package/{dist → lib}/framework/impl/checkbox/checkbox-impl.js.map +0 -0
  85. package/{dist → lib}/framework/impl/comments/comment-content-impl.d.ts +0 -0
  86. package/{dist → lib}/framework/impl/comments/comment-content-impl.js +0 -0
  87. package/{dist → lib}/framework/impl/comments/comment-content-impl.js.map +0 -0
  88. package/{dist → lib}/framework/impl/comments/comment-element-impl.d.ts +0 -0
  89. package/{dist → lib}/framework/impl/comments/comment-element-impl.js +0 -0
  90. package/{dist → lib}/framework/impl/comments/comment-element-impl.js.map +0 -0
  91. package/{dist → lib}/framework/impl/comments/comments-container-impl.d.ts +0 -0
  92. package/{dist → lib}/framework/impl/comments/comments-container-impl.js +0 -0
  93. package/{dist → lib}/framework/impl/comments/comments-container-impl.js.map +0 -0
  94. package/{dist → lib}/framework/impl/comments/comments-util.d.ts +0 -0
  95. package/{dist → lib}/framework/impl/comments/comments-util.js +0 -0
  96. package/{dist → lib}/framework/impl/comments/comments-util.js.map +0 -0
  97. package/{dist → lib}/framework/impl/comments/validate-msg-impl.d.ts +0 -0
  98. package/{dist → lib}/framework/impl/comments/validate-msg-impl.js +0 -0
  99. package/{dist → lib}/framework/impl/comments/validate-msg-impl.js.map +0 -0
  100. package/{dist → lib}/framework/impl/data-element/data-decorate-impl.d.ts +0 -0
  101. package/{dist → lib}/framework/impl/data-element/data-decorate-impl.js +0 -0
  102. package/{dist → lib}/framework/impl/data-element/data-decorate-impl.js.map +0 -0
  103. package/{dist → lib}/framework/impl/data-element/data-element-barcode.d.ts +0 -0
  104. package/{dist → lib}/framework/impl/data-element/data-element-barcode.js +0 -0
  105. package/{dist → lib}/framework/impl/data-element/data-element-barcode.js.map +0 -0
  106. package/{dist → lib}/framework/impl/data-element/data-element-base-impl.d.ts +0 -0
  107. package/{dist → lib}/framework/impl/data-element/data-element-base-impl.js +0 -0
  108. package/{dist → lib}/framework/impl/data-element/data-element-base-impl.js.map +0 -0
  109. package/{dist → lib}/framework/impl/data-element/data-element-check-impl.d.ts +0 -0
  110. package/{dist → lib}/framework/impl/data-element/data-element-check-impl.js +0 -0
  111. package/{dist → lib}/framework/impl/data-element/data-element-check-impl.js.map +0 -0
  112. package/{dist → lib}/framework/impl/data-element/data-element-date-impl.d.ts +0 -0
  113. package/{dist → lib}/framework/impl/data-element/data-element-date-impl.js +0 -0
  114. package/{dist → lib}/framework/impl/data-element/data-element-date-impl.js.map +0 -0
  115. package/{dist → lib}/framework/impl/data-element/data-element-group-impl.d.ts +0 -0
  116. package/{dist → lib}/framework/impl/data-element/data-element-group-impl.js +0 -0
  117. package/{dist → lib}/framework/impl/data-element/data-element-group-impl.js.map +0 -0
  118. package/{dist → lib}/framework/impl/data-element/data-element-image-impl.d.ts +0 -0
  119. package/{dist → lib}/framework/impl/data-element/data-element-image-impl.js +0 -0
  120. package/{dist → lib}/framework/impl/data-element/data-element-image-impl.js.map +0 -0
  121. package/{dist → lib}/framework/impl/data-element/data-element-list-impl.d.ts +0 -0
  122. package/{dist → lib}/framework/impl/data-element/data-element-list-impl.js +0 -0
  123. package/{dist → lib}/framework/impl/data-element/data-element-list-impl.js.map +0 -0
  124. package/{dist → lib}/framework/impl/data-element/data-element-text-impl.d.ts +0 -0
  125. package/{dist → lib}/framework/impl/data-element/data-element-text-impl.js +0 -0
  126. package/{dist → lib}/framework/impl/data-element/data-element-text-impl.js.map +0 -0
  127. package/{dist → lib}/framework/impl/decorate/fill-null-space-imple.d.ts +0 -0
  128. package/{dist → lib}/framework/impl/decorate/fill-null-space-imple.js +0 -0
  129. package/{dist → lib}/framework/impl/decorate/fill-null-space-imple.js.map +0 -0
  130. package/{dist → lib}/framework/impl/document/doc-body-impl.d.ts +0 -0
  131. package/{dist → lib}/framework/impl/document/doc-body-impl.js +0 -0
  132. package/{dist → lib}/framework/impl/document/doc-body-impl.js.map +0 -0
  133. package/{dist → lib}/framework/impl/document/doc-body-part-impl.d.ts +0 -0
  134. package/{dist → lib}/framework/impl/document/doc-body-part-impl.js +0 -0
  135. package/{dist → lib}/framework/impl/document/doc-body-part-impl.js.map +0 -0
  136. package/{dist → lib}/framework/impl/document/doc-container-impl.d.ts +0 -0
  137. package/{dist → lib}/framework/impl/document/doc-container-impl.js +0 -0
  138. package/{dist → lib}/framework/impl/document/doc-container-impl.js.map +0 -0
  139. package/{dist → lib}/framework/impl/document/doc-footer-impl.d.ts +0 -0
  140. package/{dist → lib}/framework/impl/document/doc-footer-impl.js +0 -0
  141. package/{dist → lib}/framework/impl/document/doc-footer-impl.js.map +0 -0
  142. package/{dist → lib}/framework/impl/document/doc-header-impl.d.ts +0 -0
  143. package/{dist → lib}/framework/impl/document/doc-header-impl.js +0 -0
  144. package/{dist → lib}/framework/impl/document/doc-header-impl.js.map +0 -0
  145. package/{dist → lib}/framework/impl/document/doc-impl.d.ts +0 -0
  146. package/{dist → lib}/framework/impl/document/doc-impl.js +0 -0
  147. package/{dist → lib}/framework/impl/document/doc-impl.js.map +0 -0
  148. package/{dist → lib}/framework/impl/media-formula/menstrual-history.d.ts +0 -0
  149. package/{dist → lib}/framework/impl/media-formula/menstrual-history.js +0 -0
  150. package/{dist → lib}/framework/impl/media-formula/menstrual-history.js.map +0 -0
  151. package/{dist → lib}/framework/impl/paragraph/p-impl.d.ts +0 -0
  152. package/{dist → lib}/framework/impl/paragraph/p-impl.js +0 -0
  153. package/{dist → lib}/framework/impl/paragraph/p-impl.js.map +0 -0
  154. package/{dist → lib}/framework/impl/picture/image-impl.d.ts +0 -0
  155. package/{dist → lib}/framework/impl/picture/image-impl.js +0 -0
  156. package/{dist → lib}/framework/impl/picture/image-impl.js.map +0 -0
  157. package/{dist → lib}/framework/impl/radio/radio-impl.d.ts +0 -0
  158. package/{dist → lib}/framework/impl/radio/radio-impl.js +0 -0
  159. package/{dist → lib}/framework/impl/radio/radio-impl.js.map +0 -0
  160. package/{dist → lib}/framework/impl/symbol/br-symbol-impl.d.ts +0 -0
  161. package/{dist → lib}/framework/impl/symbol/br-symbol-impl.js +0 -0
  162. package/{dist → lib}/framework/impl/symbol/br-symbol-impl.js.map +0 -0
  163. package/{dist → lib}/framework/impl/symbol/p-symbol-impl.d.ts +0 -0
  164. package/{dist → lib}/framework/impl/symbol/p-symbol-impl.js +0 -0
  165. package/{dist → lib}/framework/impl/symbol/p-symbol-impl.js.map +0 -0
  166. package/{dist → lib}/framework/impl/table/table-cell-impl.d.ts +0 -0
  167. package/{dist → lib}/framework/impl/table/table-cell-impl.js +0 -0
  168. package/{dist → lib}/framework/impl/table/table-cell-impl.js.map +0 -0
  169. package/{dist → lib}/framework/impl/table/table-impl.d.ts +0 -0
  170. package/{dist → lib}/framework/impl/table/table-impl.js +0 -0
  171. package/{dist → lib}/framework/impl/table/table-impl.js.map +0 -0
  172. package/{dist → lib}/framework/impl/table/table-row-impl.d.ts +0 -0
  173. package/{dist → lib}/framework/impl/table/table-row-impl.js +0 -0
  174. package/{dist → lib}/framework/impl/table/table-row-impl.js.map +0 -0
  175. package/{dist → lib}/framework/impl/table/table-split-cell-patch.d.ts +0 -0
  176. package/{dist → lib}/framework/impl/table/table-split-cell-patch.js +0 -0
  177. package/{dist → lib}/framework/impl/table/table-split-cell-patch.js.map +0 -0
  178. package/{dist → lib}/framework/impl/table/table-split-cell.d.ts +0 -0
  179. package/{dist → lib}/framework/impl/table/table-split-cell.js +0 -0
  180. package/{dist → lib}/framework/impl/table/table-split-cell.js.map +0 -0
  181. package/{dist → lib}/framework/impl/table/table-util.d.ts +0 -0
  182. package/{dist → lib}/framework/impl/table/table-util.js +0 -0
  183. package/{dist → lib}/framework/impl/table/table-util.js.map +0 -0
  184. package/{dist → lib}/framework/impl/text/text-impl.d.ts +0 -0
  185. package/{dist → lib}/framework/impl/text/text-impl.js +0 -0
  186. package/{dist → lib}/framework/impl/text/text-impl.js.map +0 -0
  187. package/{dist → lib}/framework/impl/text/track-run-impl.d.ts +0 -0
  188. package/{dist → lib}/framework/impl/text/track-run-impl.js +0 -0
  189. package/{dist → lib}/framework/impl/text/track-run-impl.js.map +0 -0
  190. package/{dist → lib}/framework/notify.d.ts +0 -0
  191. package/{dist → lib}/framework/notify.js +0 -0
  192. package/{dist → lib}/framework/notify.js.map +0 -0
  193. package/{dist → lib}/framework/range-util.d.ts +0 -0
  194. package/{dist → lib}/framework/range-util.js +0 -0
  195. package/{dist → lib}/framework/range-util.js.map +0 -0
  196. package/{dist → lib}/framework/render-context.d.ts +0 -0
  197. package/{dist → lib}/framework/render-context.js +0 -0
  198. package/{dist → lib}/framework/render-context.js.map +0 -0
  199. package/{dist → lib}/framework/render-define.d.ts +0 -0
  200. package/{dist → lib}/framework/render-define.js +0 -0
  201. package/{dist → lib}/framework/render-define.js.map +0 -0
  202. package/{dist → lib}/framework/selection-overlays.d.ts +0 -0
  203. package/{dist → lib}/framework/selection-overlays.js +0 -0
  204. package/{dist → lib}/framework/selection-overlays.js.map +0 -0
  205. package/{dist → lib}/texteditor.d.ts +0 -0
  206. package/{dist → lib}/texteditor.js +0 -0
  207. package/{dist → lib}/texteditor.js.map +0 -0
  208. package/{dist → lib}/util/subject.d.ts +0 -0
  209. package/{dist → lib}/util/subject.js +0 -0
  210. package/{dist → lib}/util/subject.js.map +0 -0
  211. package/{dist → lib}/util/table-bind.d.ts +0 -0
  212. package/{dist → lib}/util/table-bind.js +0 -0
  213. package/{dist → lib}/util/table-bind.js.map +0 -0
  214. package/package.json +7 -2
  215. package/src/med_editor/doc-ruler.ts +0 -340
  216. package/src/med_editor/framework/common-util.ts +0 -200
  217. package/src/med_editor/framework/document-change.ts +0 -1392
  218. package/src/med_editor/framework/document-combine.ts +0 -44
  219. package/src/med_editor/framework/document-comment.ts +0 -168
  220. package/src/med_editor/framework/document-context.ts +0 -410
  221. package/src/med_editor/framework/document-eval-func.ts +0 -53
  222. package/src/med_editor/framework/document-event.ts +0 -1082
  223. package/src/med_editor/framework/document-history.ts +0 -76
  224. package/src/med_editor/framework/document-images-loader.ts +0 -74
  225. package/src/med_editor/framework/document-input-cursor.ts +0 -244
  226. package/src/med_editor/framework/document-paint.ts +0 -110
  227. package/src/med_editor/framework/document-print-offscreen.ts +0 -134
  228. package/src/med_editor/framework/document-print.ts +0 -219
  229. package/src/med_editor/framework/document-segmenter.ts +0 -211
  230. package/src/med_editor/framework/document-selection.ts +0 -391
  231. package/src/med_editor/framework/document-template.ts +0 -20
  232. package/src/med_editor/framework/document-textline-mode.ts +0 -34
  233. package/src/med_editor/framework/element-define.ts +0 -674
  234. package/src/med_editor/framework/element-event-define.ts +0 -142
  235. package/src/med_editor/framework/element-measure.ts +0 -573
  236. package/src/med_editor/framework/element-paint.ts +0 -176
  237. package/src/med_editor/framework/element-props.ts +0 -938
  238. package/src/med_editor/framework/element-reader.ts +0 -159
  239. package/src/med_editor/framework/element-render-cut.ts +0 -456
  240. package/src/med_editor/framework/element-serialize.ts +0 -128
  241. package/src/med_editor/framework/element-util.ts +0 -1565
  242. package/src/med_editor/framework/impl/checkbox/checkbox-impl.ts +0 -71
  243. package/src/med_editor/framework/impl/comments/comment-content-impl.ts +0 -119
  244. package/src/med_editor/framework/impl/comments/comment-element-impl.ts +0 -65
  245. package/src/med_editor/framework/impl/comments/comments-container-impl.ts +0 -68
  246. package/src/med_editor/framework/impl/comments/comments-util.ts +0 -84
  247. package/src/med_editor/framework/impl/comments/validate-msg-impl.ts +0 -94
  248. package/src/med_editor/framework/impl/data-element/data-decorate-impl.ts +0 -95
  249. package/src/med_editor/framework/impl/data-element/data-element-barcode.ts +0 -127
  250. package/src/med_editor/framework/impl/data-element/data-element-base-impl.ts +0 -234
  251. package/src/med_editor/framework/impl/data-element/data-element-check-impl.ts +0 -146
  252. package/src/med_editor/framework/impl/data-element/data-element-date-impl.ts +0 -128
  253. package/src/med_editor/framework/impl/data-element/data-element-group-impl.ts +0 -150
  254. package/src/med_editor/framework/impl/data-element/data-element-image-impl.ts +0 -147
  255. package/src/med_editor/framework/impl/data-element/data-element-list-impl.ts +0 -142
  256. package/src/med_editor/framework/impl/data-element/data-element-text-impl.ts +0 -117
  257. package/src/med_editor/framework/impl/decorate/fill-null-space-imple.ts +0 -48
  258. package/src/med_editor/framework/impl/document/doc-body-impl.ts +0 -95
  259. package/src/med_editor/framework/impl/document/doc-body-part-impl.ts +0 -104
  260. package/src/med_editor/framework/impl/document/doc-container-impl.ts +0 -24
  261. package/src/med_editor/framework/impl/document/doc-footer-impl.ts +0 -88
  262. package/src/med_editor/framework/impl/document/doc-header-impl.ts +0 -100
  263. package/src/med_editor/framework/impl/document/doc-impl.ts +0 -226
  264. package/src/med_editor/framework/impl/media-formula/menstrual-history.ts +0 -175
  265. package/src/med_editor/framework/impl/paragraph/p-impl.ts +0 -190
  266. package/src/med_editor/framework/impl/picture/image-impl.ts +0 -136
  267. package/src/med_editor/framework/impl/radio/radio-impl.ts +0 -79
  268. package/src/med_editor/framework/impl/symbol/br-symbol-impl.ts +0 -60
  269. package/src/med_editor/framework/impl/symbol/p-symbol-impl.ts +0 -57
  270. package/src/med_editor/framework/impl/table/table-cell-impl.ts +0 -156
  271. package/src/med_editor/framework/impl/table/table-impl.ts +0 -401
  272. package/src/med_editor/framework/impl/table/table-row-impl.ts +0 -83
  273. package/src/med_editor/framework/impl/table/table-split-cell-patch.ts +0 -98
  274. package/src/med_editor/framework/impl/table/table-split-cell.ts +0 -475
  275. package/src/med_editor/framework/impl/table/table-util.ts +0 -716
  276. package/src/med_editor/framework/impl/text/text-impl.ts +0 -164
  277. package/src/med_editor/framework/impl/text/track-run-impl.ts +0 -135
  278. package/src/med_editor/framework/notify.ts +0 -130
  279. package/src/med_editor/framework/range-util.ts +0 -321
  280. package/src/med_editor/framework/render-context.ts +0 -431
  281. package/src/med_editor/framework/render-define.ts +0 -224
  282. package/src/med_editor/framework/selection-overlays.ts +0 -134
  283. package/src/med_editor/texteditor.ts +0 -1011
  284. package/src/med_editor/util/subject.ts +0 -118
  285. package/src/med_editor/util/table-bind.ts +0 -6
  286. package/src/med_editor//345/205/245/351/231/242/350/256/260/345/275/225.json +0 -3573
  287. package/src/med_editor//345/205/245/351/231/242/350/256/260/345/275/225/346/265/213/350/257/225.json +0 -3573
  288. package/src/med_editor//345/205/245/351/231/242/350/256/260/345/275/225/346/265/213/350/257/225bug.json +0 -315
  289. package/src/med_editor//345/205/245/351/231/242/350/256/260/345/275/225/346/265/213/350/257/225/346/211/271/346/263/250.json +0 -122
  290. package/src/med_editor//345/205/245/351/231/242/350/256/260/345/275/225/346/265/213/350/257/225/346/226/207/346/241/243/351/252/214/350/257/201.json +0 -3599
  291. package/src/med_editor//345/205/245/351/231/242/350/256/260/345/275/225/346/265/213/350/257/225/351/225/277/346/226/207/346/234/254.json +0 -24586
  292. package/src/med_editor//345/220/210/345/271/266/347/227/205/347/250/213/345/275/225.json +0 -2874
  293. package/src/med_editor//346/211/213/346/234/257/350/256/260/345/275/225.json +0 -341
  294. package/src/med_editor//346/231/256/351/200/232doc/347/261/273/346/226/207/346/241/243.json +0 -2201
  295. package/src/med_editor//346/243/200/351/252/214/347/224/263/350/257/267/345/215/225.json +0 -1069
  296. package/src/med_editor//347/227/205/347/250/213/345/275/225//345/206/205/351/225/234/344/270/213/346/262/273/347/226/227/350/256/260/345/275/225.json +0 -125
  297. package/src/med_editor//347/227/205/347/250/213/345/275/225//345/220/210/345/271/266/347/227/205/347/250/213/345/275/225/346/250/241/346/235/277.json +0 -86
  298. package/src/med_editor//347/227/205/347/250/213/345/275/225//346/227/245/345/270/270/347/227/205/347/250/213/350/256/260/345/275/225.json +0 -115
  299. package/src/med_editor//347/227/205/347/250/213/345/275/225//346/237/245/346/210/277/350/256/260/345/275/2251.json +0 -108
  300. package/src/med_editor//347/227/205/347/250/213/345/275/225//351/246/226/346/254/241/344/270/212/347/272/247/345/214/273/345/270/210/346/237/245/346/210/277/350/256/260/345/275/225.json +0 -272
  301. package/src/med_editor//351/225/277/346/234/237/345/214/273/345/230/261/345/215/225.json +0 -1070
  302. package/webpack.config.js +0 -46
@@ -1,431 +0,0 @@
1
- import { EditorContext } from "./document-context";
2
- import { Position, ViewOptions } from "./element-define";
3
- import { TextProps } from "./element-props";
4
- import { ElementUtil } from "./element-util";
5
- import { DocumentRenderObject } from "./impl/document/doc-impl";
6
- import { ParagraphElement } from "./impl/paragraph/p-impl";
7
- import { TextGroupElement, TextGroupRenderObject } from "./impl/text/text-impl";
8
-
9
- export interface TextUnits {
10
- sourceSize: number,
11
- actualSize: number,
12
- char: string
13
- }
14
-
15
- export type RenderContenxtType = {
16
- contentContext: PaintContent;
17
- overlaysContext: PaintContent;
18
- drawMode: 'view' | 'print';
19
- clear(): void;
20
- viewOptions: ViewOptions;
21
- docCtx: EditorContext;
22
- commit(pageSetting: { width: number, height: number } | null): void
23
- };
24
-
25
- export class RenderContenxt {
26
- contentContext!: PaintContent;
27
- overlaysContext!: PaintContent;
28
- drawMode: 'view' | 'print' = 'view';
29
- private contentOffCanvas!: HTMLCanvasElement;
30
- private overlayOffCanvas!: HTMLCanvasElement;
31
-
32
- constructor(public mainCtx: CanvasRenderingContext2D, public viewOptions: ViewOptions, public docCtx: EditorContext) {
33
- this.createNativeCanvas();
34
- }
35
-
36
- private createNativeCanvas() {
37
- this.contentOffCanvas = document.createElement('canvas');
38
- this.overlayOffCanvas = document.createElement('canvas');
39
- this.contentContext = new PaintContent(this.contentOffCanvas.getContext('2d') as CanvasRenderingContext2D, this.viewOptions);
40
- this.overlaysContext = new PaintContent(this.overlayOffCanvas.getContext('2d') as CanvasRenderingContext2D, this.viewOptions);
41
- this.setCanvasProps();
42
- }
43
-
44
- // private createOffscreenCanvas() {
45
- // this.contentOffCanvas = new OffscreenCanvas(250, 250);
46
- // this.overlayOffCanvas = new OffscreenCanvas(250, 250);
47
- // this.contentContext = new PaintContent(this.contentOffCanvas.getContext('2d') as OffscreenCanvasRenderingContext2D, this.viewOptions);
48
- // this.overlaysContext = new PaintContent(this.overlayOffCanvas.getContext('2d') as OffscreenCanvasRenderingContext2D, this.viewOptions);
49
- // this.setCanvasProps();
50
- // }
51
-
52
- setCanvasProps(pageSetting: { width: number, height: number } | null = null): void {
53
- if (!pageSetting) {
54
- pageSetting = { width: this.viewOptions.viewSettings.width, height: this.viewOptions.viewPaintHeight }
55
- if (this.viewOptions.showReviewWindow) {
56
- pageSetting.width += this.viewOptions.reviewWindowWidth;
57
- }
58
- }
59
- pageSetting = pageSetting || {
60
- width: this.viewOptions.viewSettings.width,
61
- height: this.viewOptions.viewPaintHeight
62
- };
63
- ElementUtil.setCanvasProps(this.contentOffCanvas, this.contentContext.ctx, pageSetting, this.viewOptions.scale)
64
- ElementUtil.setCanvasProps(this.overlayOffCanvas, this.overlaysContext.ctx, pageSetting, this.viewOptions.scale)
65
- ElementUtil.setCanvasProps(this.mainCtx.canvas, this.mainCtx, pageSetting, this.viewOptions.scale)
66
- }
67
-
68
- clear(): void {
69
- this.contentContext.clear();
70
- this.overlaysContext.clear();
71
- this.mainCtx.clearRect(0, 0, this.mainCtx.canvas.width, this.mainCtx.canvas.height);
72
- }
73
-
74
- commit(pageSetting: { width: number, height: number } | null = null): void {
75
- //pageSetting = pageSetting || { width: this.viewOptions.viewSettings.width, height: this.viewOptions.viewPaintHeight };
76
- if (!pageSetting) {
77
- pageSetting = { width: this.viewOptions.viewSettings.width, height: this.viewOptions.viewPaintHeight }
78
- if (this.viewOptions.showReviewWindow) {
79
- pageSetting.width += this.viewOptions.reviewWindowWidth;
80
- }
81
- }
82
- let { width, height } = pageSetting;
83
- //this.mainCtx.clearRect(0, 0, this.mainCtx.canvas.width, this.mainCtx.canvas.height);
84
- if (!this.overlayOffCanvas.width || !this.overlayOffCanvas.height) {
85
- return;
86
- }
87
-
88
- this.mainCtx.drawImage(this.overlayOffCanvas, 0, 0, ElementUtil.getDprNumber(width, this.viewOptions.scale), ElementUtil.getDprNumber(height));
89
- //console.time('drawImage');
90
- this.mainCtx.drawImage(this.contentOffCanvas, 0, 0, ElementUtil.getDprNumber(width, this.viewOptions.scale), ElementUtil.getDprNumber(height));
91
- //console.timeEnd('drawImage');
92
- }
93
-
94
- }
95
-
96
- export class PaintContent {
97
- constructor(public ctx: CanvasRenderingContext2D, private viewOptions: ViewOptions) {
98
- this.init();
99
- }
100
-
101
- init(): void {
102
- this.ctx.textBaseline = 'alphabetic';
103
- }
104
-
105
- setGlobalAlpha(alpha: number): void {
106
- this.ctx.globalAlpha = alpha;
107
- }
108
-
109
- getGlobalAlpha(): number {
110
- return this.ctx.globalAlpha;
111
- }
112
-
113
- clear(): void {
114
- this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height);
115
- this.init();
116
- }
117
-
118
- drawText(text: string, textProps: TextProps, x: number, y: number, width: number, height: number): void {
119
- if (textProps.background) {
120
- this.fillRect(x, y, width, height, textProps.background);
121
- }
122
- this.ctx.save();
123
- this.ctx.fillStyle = textProps.color;
124
- this.ctx.font = textProps.getFont();
125
- const vertHeight = textProps.vertAlign === 'superscript' ? 0 : height;
126
- this.ctx.fillText(text, x, y + vertHeight - height / 7);
127
- this.ctx.restore();
128
- if (textProps.linethrough) {
129
- this.drawLine(x, y + (Math.ceil(height / 2)), width, textProps.color, 1);
130
- }
131
- if (textProps.underline) {
132
- this.drawLine(x, y + height, width, textProps.color, 1);
133
- }
134
- if (textProps.overline) {
135
- this.drawLine(x, y, width, textProps.color, 1);
136
- }
137
- }
138
-
139
- fillCircular(x: number, y: number, r: number, color: string = 'black'): void {
140
- this.ctx.save();
141
- this.ctx.beginPath();
142
- this.ctx.fillStyle = color;
143
- this.ctx.arc(x, y, r, 0, 2 * Math.PI);
144
- this.ctx.fill();
145
- this.ctx.restore();
146
- }
147
-
148
- drawTextUnits(textGroupRender: TextGroupRenderObject, x: number, y: number): void {
149
- const textEle = textGroupRender.element as TextGroupElement;
150
- const textProps = textEle.props;
151
- const { width, height } = textGroupRender.rect;
152
- this.ctx.save();
153
- this.ctx.fillStyle = textProps.color;
154
- this.ctx.font = textProps.getFont();
155
- if (textProps.background) {
156
- this.fillRect(x, y, width, height, textProps.background);
157
- }
158
- if (textProps.linethrough) {
159
- this.drawLine(x, y + (Math.ceil(height / 2)), width, textProps.color, 1);
160
- }
161
- if (textProps.underline) {
162
- this.drawLine(x, y + height, width, textProps.color, 1);
163
- }
164
- if (textProps.overline) {
165
- this.drawLine(x, y, width, textProps.color, 1);
166
- }
167
- let horX = 0;
168
- let vertHeight = height - (height / 7);
169
- if (textProps.vertAlign === 'superscript') {
170
- //到top
171
- vertHeight -= textProps.fontSize * 2 / 5;
172
- //top在向上收缩 -top行间距
173
- //vertHeight -= textProps.fontSize * this.getParaLineHeight(textEle) / 20
174
- }
175
- for (let i = 0; i < textGroupRender.textMeasures.length; i++) {
176
- const unit = textGroupRender.textMeasures[i];
177
- this.ctx.fillText(unit.char, x + horX, y + vertHeight);
178
- horX += unit.actualSize;
179
- }
180
- this.ctx.restore();
181
- }
182
-
183
- getParaLineHeight(textEle: TextGroupElement): number {
184
- const para = ElementUtil.getParentByType(textEle, ParagraphElement);
185
- if (!para) {
186
- throw new Error('未能找到父级段落元素')
187
- }
188
- return para.props.lineHeight;
189
- }
190
-
191
- measureText(text: string, textProps: TextProps): { width: number, height: number } {
192
- this.ctx.fillStyle = textProps.color;
193
- this.ctx.font = textProps.getFont();
194
- const textMeasure = this.ctx.measureText(text);
195
- return { width: textMeasure.width, height: textProps.fontSize };
196
- }
197
-
198
-
199
- measureTextUnits(units: Array<TextUnits>, textProps: TextProps): void {
200
- this.ctx.font = textProps.getFont();
201
- const letterSpace = textProps.letterSpace ?? 0;
202
- for (let i = 0; i < units.length; i++) {
203
- const char = units[i];
204
- const textMeasure = this.ctx.measureText(char.char);
205
- char.actualSize = textMeasure.width + letterSpace;
206
- char.sourceSize = textMeasure.width;
207
- }
208
- }
209
-
210
- clearRect(x: number, y: number, width: number, height: number): void {
211
- this.ctx.clearRect(x, y, width, height);
212
- }
213
-
214
- save(): void {
215
- this.ctx.save();
216
- }
217
-
218
- restore(): void {
219
- this.ctx.restore();
220
- }
221
-
222
-
223
- strokeRect(x: number, y: number, width: number, height: number, strokeColor = 'black', strokeWidth = 1): void {
224
- x = Math.ceil(x);
225
- y = Math.ceil(y);
226
- x += 0.5;
227
- y += 0.5;
228
- this.ctx.save();
229
- this.ctx.lineWidth = strokeWidth;
230
- this.ctx.strokeStyle = strokeColor;
231
- this.ctx.strokeRect(x, y, width, height);
232
- this.ctx.restore();
233
- //this.strokeLines([{ x, y }, { x: x + width, y }, { x: x + width, y: y + height }, { x, y: y + height }, { x, y }], strokeWidth, strokeColor);
234
- }
235
-
236
- //strokeRectImageData(x:number)
237
-
238
- drawLine(x: number, y: number, width: number, lineColor = 'black', lineWidth = 1): void {
239
- x = Math.ceil(x);
240
- y = Math.ceil(y);
241
- x += 0.5;
242
- y += 0.5;
243
- this.ctx.save();
244
- this.ctx.strokeStyle = lineColor;
245
- this.ctx.lineWidth = lineWidth;
246
- this.ctx.beginPath();
247
- this.ctx.moveTo(x, y);
248
- this.ctx.lineTo(x + width, y);
249
- this.ctx.stroke();
250
- this.ctx.closePath();
251
- this.ctx.restore();
252
- }
253
-
254
- fillRect(x: number, y: number, width: number, height: number, fillColor = 'white', shadowBlur = 0, shadowColor = 'black'): void {
255
- x = Math.ceil(x);
256
- y = Math.ceil(y);
257
- x += 0.5;
258
- y += 0.5;
259
- this.ctx.save();
260
- this.ctx.fillStyle = fillColor;
261
- this.ctx.shadowBlur = shadowBlur;
262
- this.ctx.shadowColor = shadowColor;
263
- this.ctx.beginPath();
264
- this.ctx.moveTo(x, y);
265
- this.ctx.lineTo(x + width, y);
266
- this.ctx.lineTo(x + width, y + height);
267
- this.ctx.lineTo(x, y + height);
268
- this.ctx.lineTo(x, y);
269
- this.ctx.fill();
270
- this.ctx.closePath();
271
- this.ctx.restore();
272
- }
273
-
274
- strokeLines(lines: Array<Position>, width = 1, strokeColor = 'black'): void {
275
- this.ctx.save();
276
- this.ctx.strokeStyle = strokeColor;
277
- this.ctx.lineWidth = width;
278
- this.ctx.lineCap = 'round';
279
- this.ctx.beginPath();
280
- for (let i = 0; i < lines.length; i++) {
281
- let { x, y } = lines[i];
282
- x = Math.ceil(x);
283
- y = Math.ceil(y);
284
- x += 0.5;
285
- y += 0.5;
286
- if (i === 0) {
287
- this.ctx.moveTo(x, y);
288
- } else {
289
- this.ctx.lineTo(x, y);
290
- }
291
- }
292
- this.ctx.stroke();
293
- this.ctx.closePath();
294
- this.ctx.restore();
295
- }
296
-
297
- fillLines(lines: Array<Position>, width = 1, fillColor = 'black'): void {
298
- this.ctx.save();
299
- this.ctx.beginPath();
300
- this.ctx.fillStyle = fillColor;
301
- this.ctx.lineWidth = width;
302
- for (let i = 0; i < lines.length; i++) {
303
- let { x, y } = lines[i];
304
- x = Math.ceil(x);
305
- y = Math.ceil(y);
306
- x += 0.5;
307
- y += 0.5;
308
- if (i === 0) {
309
- this.ctx.moveTo(x, y);
310
- } else {
311
- this.ctx.lineTo(x, y);
312
- }
313
- }
314
- this.ctx.stroke();
315
- this.ctx.closePath();
316
- this.ctx.restore();
317
- }
318
-
319
-
320
- drawCheckBox(x: number, y: number, width: number, height: number, isChecked: boolean): void {
321
- this.strokeRect(x, y, width, height, 'black', 1);
322
- if (isChecked) {
323
- const lines: Array<Position> = [];
324
- lines.push({ x: x + (Math.ceil(width / 4)), y: y + (Math.ceil(height / 2)) });
325
- lines.push({ x: x + (Math.ceil(width / 2)), y: y + (Math.floor(height * 3 / 4)) });
326
- lines.push({ x: x + (Math.ceil(width * 3 / 4)), y: y + (Math.ceil(height / 4)) });
327
- this.strokeLines(lines, 2, 'red');
328
- }
329
- }
330
-
331
- drawRadioBox(x: number, y: number, width: number, height: number, isChecked: boolean): void {
332
- x = x + Math.floor(width / 2);
333
- y = y + Math.floor(height / 2);
334
- width = Math.floor(width / 2);
335
- this.ctx.save();
336
- this.ctx.strokeStyle = 'black';
337
- this.ctx.beginPath();
338
- this.ctx.arc(x, y, width, 0, 2 * Math.PI);
339
- this.ctx.stroke();
340
- this.ctx.closePath();
341
- if (isChecked) {
342
- this.ctx.fillStyle = 'black';
343
- this.ctx.beginPath();
344
- this.ctx.arc(x, y, Math.floor(width / 5 * 3), 0, 2 * Math.PI);
345
- this.ctx.closePath();
346
- this.ctx.fill();
347
- }
348
- this.ctx.restore();
349
- }
350
-
351
-
352
- /**
353
- * 绘制图片
354
- * @param image
355
- * @param sx image的矩形(裁剪)选择框的左上角 X 轴坐标
356
- * @param sy image的矩形(裁剪)选择框的左上角 Y 轴坐标
357
- * @param sWidth image的矩形(裁剪)选择框的宽度
358
- * @param sHeight image的矩形(裁剪)选择框的高度
359
- * @param dx image的左上角在目标canvas上 X 轴坐标
360
- * @param dy image的左上角在目标canvas上 Y 轴坐标
361
- * @param dWidth image在目标canvas上绘制的宽度
362
- * @param dHeight image在目标canvas上绘制的高度
363
- */
364
- drawImage(image: HTMLImageElement, sx: number, sy: number, sWidth: number, sHeight: number, dx: number, dy: number, dWidth: number, dHeight: number): void {
365
- this.ctx.drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight);
366
- }
367
-
368
- drawDashLine(points: Array<Position>, lineDash: Array<number>, lineColor = 'black', lineWidth = 1): void {
369
- this.ctx.save();
370
- this.ctx.setLineDash(lineDash);
371
- this.ctx.strokeStyle = lineColor;
372
- this.ctx.lineWidth = lineWidth;
373
- this.ctx.beginPath();
374
- for (let i = 0; i < points.length; i++) {
375
- let { x, y } = points[i];
376
- x += 0.5;
377
- y += 0.5;
378
- if (i === 0) {
379
- this.ctx.moveTo(x, y);
380
- } else {
381
- this.ctx.lineTo(x, y);
382
- }
383
- }
384
- this.ctx.stroke();
385
- this.ctx.closePath();
386
- this.ctx.restore();
387
- }
388
-
389
- roundRect(x: number, y: number, width: number, height: number, radius: number | { tl: number, tr: number, br: number, bl: number }, fill: boolean, stroke: boolean) {
390
- x += 0.5;
391
- y += 0.5;
392
- if (typeof stroke === 'undefined') {
393
- stroke = true;
394
- }
395
- if (typeof radius === 'number') {
396
- radius = { tl: radius, tr: radius, br: radius, bl: radius };
397
- } else {
398
- var defaultRadius = { tl: 0, tr: 0, br: 0, bl: 0 };
399
- for (var side in defaultRadius) {
400
- radius[side] = radius[side] || defaultRadius[side];
401
- }
402
- }
403
- this.ctx.beginPath();
404
- this.ctx.lineWidth = 1;
405
- this.ctx.moveTo(x + radius.tl, y);
406
- this.ctx.lineTo(x + width - radius.tr, y);
407
- this.ctx.quadraticCurveTo(x + width, y, x + width, y + radius.tr);
408
- this.ctx.lineTo(x + width, y + height - radius.br);
409
- this.ctx.quadraticCurveTo(x + width, y + height, x + width - radius.br, y + height);
410
- this.ctx.lineTo(x + radius.bl, y + height);
411
- this.ctx.quadraticCurveTo(x, y + height, x, y + height - radius.bl);
412
- this.ctx.lineTo(x, y + radius.tl);
413
- this.ctx.quadraticCurveTo(x, y, x + radius.tl, y);
414
- this.ctx.closePath();
415
- if (fill) {
416
- this.ctx.fill();
417
- }
418
- if (stroke) {
419
- this.ctx.stroke();
420
- }
421
-
422
- }
423
-
424
- clip(x: number, y: number, width: number, height: number): void {
425
- this.ctx.save();
426
- this.ctx.beginPath();
427
- this.ctx.rect(x, y, width, height);
428
- this.ctx.clip();
429
- }
430
-
431
- }
@@ -1,224 +0,0 @@
1
- import { Rect, Element, MarginProps, PaddingProps, Position } from './element-define'
2
- import { RenderContenxtType } from './render-context';
3
- /**
4
- * 定义组件的UI形式的渲染
5
- */
6
- export abstract class RenderObject<T extends Element = Element> {
7
- margin!: MarginProps;
8
- padding!: PaddingProps;
9
- rect: Rect = new Rect();
10
- parent!: BranchRenderObject;
11
- /**
12
- * 可点击性,例如:null-text 占位符元素不具备可点击能力
13
- */
14
- disableClick!: boolean;
15
- constructor(public element: T) {
16
- this.margin = new MarginProps();
17
- this.padding = new PaddingProps();
18
- }
19
- abstract clone(): RenderObject;
20
- pagePaintCompleted(ctx: RenderContenxtType, position: Position): void { }
21
- destroy(): void {
22
- //this.parent = null;
23
- //this.margin = null;
24
- //this.padding = null;
25
- //this.rect = null;
26
- //this.element = null;
27
- }
28
-
29
- /**
30
- * 获取内容区域框体
31
- * @param render
32
- * @returns
33
- */
34
- getInnnerRect(): Rect {
35
- const { padding } = this;
36
- const rect = new Rect();
37
- rect.x = padding.left;
38
- rect.y = padding.top;
39
- rect.maxWidth = this.rect.maxWidth - padding.left - padding.right;
40
- if (this.rect.maxHeight) {
41
- rect.maxHeight = this.rect.maxHeight - padding.top - padding.bottom;
42
- }
43
- return rect;
44
- }
45
-
46
- getInnerMaxWidth(): number {
47
- if (!this.rect.maxWidth) {
48
- throw new Error('this.rect.maxWidth is null')
49
- }
50
- const { padding, margin } = this;
51
- return this.rect.maxWidth - padding.left - padding.right - margin.left - margin.bottom;
52
- }
53
-
54
- /**
55
- * 根据内框内容高度,更新外框框体高度
56
- * @param render
57
- * @param innerRect
58
- */
59
- updateRenderHeight(innerRect: Rect | number): void {
60
- const innnerHeight = typeof innerRect === 'number' ? innerRect : (<Rect>innerRect).height;
61
- const { padding, margin } = this;
62
- //外层容器高度等于内容高度+外边距+内边距
63
- this.rect.height = innnerHeight + padding.top + padding.bottom;
64
- }
65
-
66
- getIndex(): number {
67
- if (this.parent) {
68
- return this.parent.getChildIndex(this);
69
- } else {
70
- return 0;
71
- }
72
- }
73
- }
74
-
75
- /**
76
- * 叶子节点渲染元素
77
- */
78
- export abstract class LeafRenderObject<T extends Element = Element> extends RenderObject<T> {
79
- constructor(element: T | null) {
80
- super(element as T);
81
- }
82
- abstract render(ctx: RenderContenxtType, position: { x: number, y: number }): void;
83
-
84
- }
85
-
86
- /**
87
- * 枝干节点渲染元素
88
- */
89
- export abstract class BranchRenderObject<T extends Element = Element> extends RenderObject<T> {
90
- constructor(element: T | null) {
91
- super(element as T);
92
- }
93
- private chilren: Array<RenderObject> = [];
94
- getItems(): Array<RenderObject> {
95
- return this.chilren;
96
- }
97
-
98
- addChild(...items: Array<RenderObject>): void {
99
- for (let i = 0; i < items.length; i++) {
100
- const item = items[i];
101
- item.parent = this;
102
- this.chilren.push(item);
103
- }
104
- }
105
-
106
- insertChild(item: RenderObject, index: number): void {
107
- this.chilren.splice(index, 0, item);
108
- item.parent = this;
109
- }
110
-
111
- removeChild(child: RenderObject): void {
112
- const index = this.chilren.indexOf(child);
113
- if (index < 0) {
114
- throw new Error('为查找到当前元素');
115
- }
116
- if (child.parent === this) {
117
- //child.parent = null;
118
- }
119
- this.chilren.splice(index, 1);
120
- }
121
-
122
- removeChildByIndex(index: number): void {
123
- const child = this.chilren[index];
124
- if (child) {
125
- this.chilren.splice(index, 1);
126
- //child.parent = null;
127
- } else {
128
- throw new Error('为查找到当前元素');
129
- }
130
- }
131
-
132
- clear(): void {
133
- const items = [...this.chilren];
134
- for (let i = items.length - 1; i >= 0; i--) {
135
- this.removeChildByIndex(i);
136
- }
137
- }
138
- get length() {
139
- return this.chilren.length;
140
- }
141
-
142
-
143
- getChild<T extends RenderObject = RenderObject>(index: number): T {
144
- return this.chilren[index] as T;
145
- }
146
-
147
- getChildIndex(child: RenderObject): number {
148
- return this.chilren.indexOf(child);
149
- }
150
-
151
- abstract beginRender(ctx: RenderContenxtType, position: Position): void;
152
- abstract endRender(ctx: RenderContenxtType, position: Position): void;
153
-
154
- destroy(): void {
155
- super.destroy();
156
- const len = this.length;
157
- for (let i = len - 1; i >= 0; i--) {
158
- const child = this.getChild(i);
159
- child.destroy();
160
- //this.removeChild(child);
161
- }
162
- this.chilren.length = 0;
163
- //this.chilren = null;
164
- }
165
- }
166
-
167
-
168
- /**
169
- * 块级渲染元素
170
- */
171
- export abstract class BlockContentRenderObject<T extends Element = Element> extends BranchRenderObject<T> {
172
- setRenderWidth(maxWidth: number): void {
173
- this.rect.maxWidth = maxWidth;
174
- this.rect.width = maxWidth;
175
- }
176
- }
177
-
178
- export abstract class InlineGroupRenderObject<T extends Element = Element> extends BranchRenderObject<T> {
179
- }
180
-
181
- /**
182
- * 包含块级渲染元素的容器元素,例如body、table-cell等
183
- */
184
- export abstract class BlockContainerRenderObject<T extends Element = Element> extends BranchRenderObject<T> {
185
- setRenderWidth(maxWidth: number): void {
186
- this.rect.maxWidth = maxWidth;
187
- this.rect.width = maxWidth;
188
- }
189
- }
190
-
191
- /**
192
- * 多级 ‘BlockLineRectRenderObject’ 包裹元素,例如 p、table
193
- */
194
- export abstract class MuiltBlockLineRenderObject<T extends Element = Element> extends BlockContentRenderObject<T> { }
195
-
196
- /**
197
- * 容器-子内容为多个行内块级元素,例如table-row
198
- */
199
- export abstract class InlineBlockContainer extends MuiltBlockLineRenderObject { }
200
-
201
- /**
202
- * 服务于table-cell
203
- * 可被多级拆分的元素
204
- */
205
- export abstract class InlineMuiltBlockLineRenderObject extends MuiltBlockLineRenderObject { }
206
-
207
- /**
208
- * 最小不可分割单位的块级行框,例如 p-line
209
- * 一行不可存在于两个页面中,块级行框不能分布在两个页面中
210
- */
211
- export abstract class BlockLineRectRenderObject extends BlockContentRenderObject { }
212
-
213
-
214
- export type BorderType = 'left' | 'right' | 'top' | 'bottom' | 'left-middle' | 'right-middle' | 'top-middle' | 'bottom-middle' | 'none' | 'left-top' | 'left-bottom' | 'right-top' | 'right-bottom';
215
- export type CursorType = 'text' | 'row-resize' | 'col-resize' | 'none' | 'default' | 'move' | 'pointer' | 'w-resize' | 's-resize' | 'se-resize' | 'ne-resize';
216
- export enum RenderObjectType {
217
- Branch = 0,
218
- Leaf = 1
219
- }
220
-
221
- export interface IMeasureRenderStruct<T> {
222
- rect: Rect,
223
- render: T
224
- }