@hailin-zheng/editor-core 1.0.1 → 1.0.5

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 (216) hide show
  1. package/package.json +1 -1
  2. package/tsconfig.json +1 -1
  3. package/webpack.config.js +0 -1
  4. package/dist/doc-ruler.d.ts +0 -51
  5. package/dist/doc-ruler.js +0 -313
  6. package/dist/doc-ruler.js.map +0 -1
  7. package/dist/framework/common-util.d.ts +0 -63
  8. package/dist/framework/common-util.js +0 -178
  9. package/dist/framework/common-util.js.map +0 -1
  10. package/dist/framework/document-change.d.ts +0 -265
  11. package/dist/framework/document-change.js +0 -1342
  12. package/dist/framework/document-change.js.map +0 -1
  13. package/dist/framework/document-combine.d.ts +0 -24
  14. package/dist/framework/document-combine.js +0 -40
  15. package/dist/framework/document-combine.js.map +0 -1
  16. package/dist/framework/document-comment.d.ts +0 -46
  17. package/dist/framework/document-comment.js +0 -148
  18. package/dist/framework/document-comment.js.map +0 -1
  19. package/dist/framework/document-context.d.ts +0 -149
  20. package/dist/framework/document-context.js +0 -330
  21. package/dist/framework/document-context.js.map +0 -1
  22. package/dist/framework/document-eval-func.d.ts +0 -18
  23. package/dist/framework/document-eval-func.js +0 -48
  24. package/dist/framework/document-eval-func.js.map +0 -1
  25. package/dist/framework/document-event.d.ts +0 -213
  26. package/dist/framework/document-event.js +0 -1054
  27. package/dist/framework/document-event.js.map +0 -1
  28. package/dist/framework/document-history.d.ts +0 -26
  29. package/dist/framework/document-history.js +0 -65
  30. package/dist/framework/document-history.js.map +0 -1
  31. package/dist/framework/document-images-loader.d.ts +0 -16
  32. package/dist/framework/document-images-loader.js +0 -66
  33. package/dist/framework/document-images-loader.js.map +0 -1
  34. package/dist/framework/document-input-cursor.d.ts +0 -78
  35. package/dist/framework/document-input-cursor.js +0 -239
  36. package/dist/framework/document-input-cursor.js.map +0 -1
  37. package/dist/framework/document-paint.d.ts +0 -34
  38. package/dist/framework/document-paint.js +0 -103
  39. package/dist/framework/document-paint.js.map +0 -1
  40. package/dist/framework/document-print-offscreen.d.ts +0 -38
  41. package/dist/framework/document-print-offscreen.js +0 -128
  42. package/dist/framework/document-print-offscreen.js.map +0 -1
  43. package/dist/framework/document-print.d.ts +0 -60
  44. package/dist/framework/document-print.js +0 -203
  45. package/dist/framework/document-print.js.map +0 -1
  46. package/dist/framework/document-segmenter.d.ts +0 -2
  47. package/dist/framework/document-segmenter.js +0 -106
  48. package/dist/framework/document-segmenter.js.map +0 -1
  49. package/dist/framework/document-selection.d.ts +0 -89
  50. package/dist/framework/document-selection.js +0 -358
  51. package/dist/framework/document-selection.js.map +0 -1
  52. package/dist/framework/document-template.d.ts +0 -4
  53. package/dist/framework/document-template.js +0 -20
  54. package/dist/framework/document-template.js.map +0 -1
  55. package/dist/framework/document-textline-mode.d.ts +0 -7
  56. package/dist/framework/document-textline-mode.js +0 -30
  57. package/dist/framework/document-textline-mode.js.map +0 -1
  58. package/dist/framework/element-define.d.ts +0 -319
  59. package/dist/framework/element-define.js +0 -579
  60. package/dist/framework/element-define.js.map +0 -1
  61. package/dist/framework/element-event-define.d.ts +0 -99
  62. package/dist/framework/element-event-define.js +0 -108
  63. package/dist/framework/element-event-define.js.map +0 -1
  64. package/dist/framework/element-measure.d.ts +0 -97
  65. package/dist/framework/element-measure.js +0 -551
  66. package/dist/framework/element-measure.js.map +0 -1
  67. package/dist/framework/element-paint.d.ts +0 -42
  68. package/dist/framework/element-paint.js +0 -170
  69. package/dist/framework/element-paint.js.map +0 -1
  70. package/dist/framework/element-props.d.ts +0 -301
  71. package/dist/framework/element-props.js +0 -809
  72. package/dist/framework/element-props.js.map +0 -1
  73. package/dist/framework/element-reader.d.ts +0 -19
  74. package/dist/framework/element-reader.js +0 -151
  75. package/dist/framework/element-reader.js.map +0 -1
  76. package/dist/framework/element-render-cut.d.ts +0 -55
  77. package/dist/framework/element-render-cut.js +0 -449
  78. package/dist/framework/element-render-cut.js.map +0 -1
  79. package/dist/framework/element-serialize.d.ts +0 -30
  80. package/dist/framework/element-serialize.js +0 -113
  81. package/dist/framework/element-serialize.js.map +0 -1
  82. package/dist/framework/element-util.d.ts +0 -369
  83. package/dist/framework/element-util.js +0 -1463
  84. package/dist/framework/element-util.js.map +0 -1
  85. package/dist/framework/impl/checkbox/checkbox-impl.d.ts +0 -24
  86. package/dist/framework/impl/checkbox/checkbox-impl.js +0 -64
  87. package/dist/framework/impl/checkbox/checkbox-impl.js.map +0 -1
  88. package/dist/framework/impl/comments/comment-content-impl.d.ts +0 -40
  89. package/dist/framework/impl/comments/comment-content-impl.js +0 -105
  90. package/dist/framework/impl/comments/comment-content-impl.js.map +0 -1
  91. package/dist/framework/impl/comments/comment-element-impl.d.ts +0 -21
  92. package/dist/framework/impl/comments/comment-element-impl.js +0 -62
  93. package/dist/framework/impl/comments/comment-element-impl.js.map +0 -1
  94. package/dist/framework/impl/comments/comments-container-impl.d.ts +0 -22
  95. package/dist/framework/impl/comments/comments-container-impl.js +0 -62
  96. package/dist/framework/impl/comments/comments-container-impl.js.map +0 -1
  97. package/dist/framework/impl/comments/comments-util.d.ts +0 -12
  98. package/dist/framework/impl/comments/comments-util.js +0 -67
  99. package/dist/framework/impl/comments/comments-util.js.map +0 -1
  100. package/dist/framework/impl/comments/validate-msg-impl.d.ts +0 -21
  101. package/dist/framework/impl/comments/validate-msg-impl.js +0 -83
  102. package/dist/framework/impl/comments/validate-msg-impl.js.map +0 -1
  103. package/dist/framework/impl/data-element/data-decorate-impl.d.ts +0 -30
  104. package/dist/framework/impl/data-element/data-decorate-impl.js +0 -91
  105. package/dist/framework/impl/data-element/data-decorate-impl.js.map +0 -1
  106. package/dist/framework/impl/data-element/data-element-barcode.d.ts +0 -31
  107. package/dist/framework/impl/data-element/data-element-barcode.js +0 -115
  108. package/dist/framework/impl/data-element/data-element-barcode.js.map +0 -1
  109. package/dist/framework/impl/data-element/data-element-base-impl.d.ts +0 -68
  110. package/dist/framework/impl/data-element/data-element-base-impl.js +0 -205
  111. package/dist/framework/impl/data-element/data-element-base-impl.js.map +0 -1
  112. package/dist/framework/impl/data-element/data-element-check-impl.d.ts +0 -35
  113. package/dist/framework/impl/data-element/data-element-check-impl.js +0 -133
  114. package/dist/framework/impl/data-element/data-element-check-impl.js.map +0 -1
  115. package/dist/framework/impl/data-element/data-element-date-impl.d.ts +0 -23
  116. package/dist/framework/impl/data-element/data-element-date-impl.js +0 -111
  117. package/dist/framework/impl/data-element/data-element-date-impl.js.map +0 -1
  118. package/dist/framework/impl/data-element/data-element-group-impl.d.ts +0 -23
  119. package/dist/framework/impl/data-element/data-element-group-impl.js +0 -130
  120. package/dist/framework/impl/data-element/data-element-group-impl.js.map +0 -1
  121. package/dist/framework/impl/data-element/data-element-image-impl.d.ts +0 -30
  122. package/dist/framework/impl/data-element/data-element-image-impl.js +0 -137
  123. package/dist/framework/impl/data-element/data-element-image-impl.js.map +0 -1
  124. package/dist/framework/impl/data-element/data-element-list-impl.d.ts +0 -22
  125. package/dist/framework/impl/data-element/data-element-list-impl.js +0 -131
  126. package/dist/framework/impl/data-element/data-element-list-impl.js.map +0 -1
  127. package/dist/framework/impl/data-element/data-element-text-impl.d.ts +0 -23
  128. package/dist/framework/impl/data-element/data-element-text-impl.js +0 -103
  129. package/dist/framework/impl/data-element/data-element-text-impl.js.map +0 -1
  130. package/dist/framework/impl/decorate/fill-null-space-imple.d.ts +0 -21
  131. package/dist/framework/impl/decorate/fill-null-space-imple.js +0 -43
  132. package/dist/framework/impl/decorate/fill-null-space-imple.js.map +0 -1
  133. package/dist/framework/impl/document/doc-body-impl.d.ts +0 -27
  134. package/dist/framework/impl/document/doc-body-impl.js +0 -79
  135. package/dist/framework/impl/document/doc-body-impl.js.map +0 -1
  136. package/dist/framework/impl/document/doc-body-part-impl.d.ts +0 -30
  137. package/dist/framework/impl/document/doc-body-part-impl.js +0 -94
  138. package/dist/framework/impl/document/doc-body-part-impl.js.map +0 -1
  139. package/dist/framework/impl/document/doc-container-impl.d.ts +0 -16
  140. package/dist/framework/impl/document/doc-container-impl.js +0 -21
  141. package/dist/framework/impl/document/doc-container-impl.js.map +0 -1
  142. package/dist/framework/impl/document/doc-footer-impl.d.ts +0 -26
  143. package/dist/framework/impl/document/doc-footer-impl.js +0 -77
  144. package/dist/framework/impl/document/doc-footer-impl.js.map +0 -1
  145. package/dist/framework/impl/document/doc-header-impl.d.ts +0 -26
  146. package/dist/framework/impl/document/doc-header-impl.js +0 -83
  147. package/dist/framework/impl/document/doc-header-impl.js.map +0 -1
  148. package/dist/framework/impl/document/doc-impl.d.ts +0 -61
  149. package/dist/framework/impl/document/doc-impl.js +0 -209
  150. package/dist/framework/impl/document/doc-impl.js.map +0 -1
  151. package/dist/framework/impl/media-formula/menstrual-history.d.ts +0 -35
  152. package/dist/framework/impl/media-formula/menstrual-history.js +0 -153
  153. package/dist/framework/impl/media-formula/menstrual-history.js.map +0 -1
  154. package/dist/framework/impl/paragraph/p-impl.d.ts +0 -45
  155. package/dist/framework/impl/paragraph/p-impl.js +0 -156
  156. package/dist/framework/impl/paragraph/p-impl.js.map +0 -1
  157. package/dist/framework/impl/picture/image-impl.d.ts +0 -31
  158. package/dist/framework/impl/picture/image-impl.js +0 -124
  159. package/dist/framework/impl/picture/image-impl.js.map +0 -1
  160. package/dist/framework/impl/radio/radio-impl.d.ts +0 -22
  161. package/dist/framework/impl/radio/radio-impl.js +0 -72
  162. package/dist/framework/impl/radio/radio-impl.js.map +0 -1
  163. package/dist/framework/impl/symbol/br-symbol-impl.d.ts +0 -22
  164. package/dist/framework/impl/symbol/br-symbol-impl.js +0 -54
  165. package/dist/framework/impl/symbol/br-symbol-impl.js.map +0 -1
  166. package/dist/framework/impl/symbol/p-symbol-impl.d.ts +0 -19
  167. package/dist/framework/impl/symbol/p-symbol-impl.js +0 -54
  168. package/dist/framework/impl/symbol/p-symbol-impl.js.map +0 -1
  169. package/dist/framework/impl/table/table-cell-impl.d.ts +0 -37
  170. package/dist/framework/impl/table/table-cell-impl.js +0 -145
  171. package/dist/framework/impl/table/table-cell-impl.js.map +0 -1
  172. package/dist/framework/impl/table/table-impl.d.ts +0 -55
  173. package/dist/framework/impl/table/table-impl.js +0 -363
  174. package/dist/framework/impl/table/table-impl.js.map +0 -1
  175. package/dist/framework/impl/table/table-row-impl.d.ts +0 -26
  176. package/dist/framework/impl/table/table-row-impl.js +0 -75
  177. package/dist/framework/impl/table/table-row-impl.js.map +0 -1
  178. package/dist/framework/impl/table/table-split-cell-patch.d.ts +0 -20
  179. package/dist/framework/impl/table/table-split-cell-patch.js +0 -89
  180. package/dist/framework/impl/table/table-split-cell-patch.js.map +0 -1
  181. package/dist/framework/impl/table/table-split-cell.d.ts +0 -90
  182. package/dist/framework/impl/table/table-split-cell.js +0 -464
  183. package/dist/framework/impl/table/table-split-cell.js.map +0 -1
  184. package/dist/framework/impl/table/table-util.d.ts +0 -150
  185. package/dist/framework/impl/table/table-util.js +0 -678
  186. package/dist/framework/impl/table/table-util.js.map +0 -1
  187. package/dist/framework/impl/text/text-impl.d.ts +0 -32
  188. package/dist/framework/impl/text/text-impl.js +0 -149
  189. package/dist/framework/impl/text/text-impl.js.map +0 -1
  190. package/dist/framework/impl/text/track-run-impl.d.ts +0 -27
  191. package/dist/framework/impl/text/track-run-impl.js +0 -112
  192. package/dist/framework/impl/text/track-run-impl.js.map +0 -1
  193. package/dist/framework/notify.d.ts +0 -13
  194. package/dist/framework/notify.js +0 -116
  195. package/dist/framework/notify.js.map +0 -1
  196. package/dist/framework/range-util.d.ts +0 -40
  197. package/dist/framework/range-util.js +0 -312
  198. package/dist/framework/range-util.js.map +0 -1
  199. package/dist/framework/render-context.d.ts +0 -91
  200. package/dist/framework/render-context.js +0 -384
  201. package/dist/framework/render-context.js.map +0 -1
  202. package/dist/framework/render-define.d.ts +0 -109
  203. package/dist/framework/render-define.js +0 -195
  204. package/dist/framework/render-define.js.map +0 -1
  205. package/dist/framework/selection-overlays.d.ts +0 -30
  206. package/dist/framework/selection-overlays.js +0 -124
  207. package/dist/framework/selection-overlays.js.map +0 -1
  208. package/dist/texteditor.d.ts +0 -318
  209. package/dist/texteditor.js +0 -913
  210. package/dist/texteditor.js.map +0 -1
  211. package/dist/util/subject.d.ts +0 -34
  212. package/dist/util/subject.js +0 -88
  213. package/dist/util/subject.js.map +0 -1
  214. package/dist/util/table-bind.d.ts +0 -5
  215. package/dist/util/table-bind.js +0 -6
  216. package/dist/util/table-bind.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hailin-zheng/editor-core",
3
- "version": "1.0.1",
3
+ "version": "1.0.5",
4
4
  "description": "",
5
5
  "main": "texteditor.ts",
6
6
  "scripts": {
package/tsconfig.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "outDir": "./dist/",
3
+ "outDir": "./lib/",
4
4
  "noImplicitAny": false,
5
5
  "target": "esnext",
6
6
  "module": "esnext",
package/webpack.config.js CHANGED
@@ -6,7 +6,6 @@ module.exports = {
6
6
  app: "./src/index.ts",
7
7
  },
8
8
  mode: "development",
9
- devtool: "inline-source-map",
10
9
  devServer: {
11
10
  static: path.join(__dirname, "dist"),
12
11
  client: {
@@ -1,51 +0,0 @@
1
- import { SelectionState } from "./framework/document-selection";
2
- import { ViewOptions } from "./framework/element-define";
3
- export interface RuleOptions {
4
- width: number;
5
- pagePL: number;
6
- pagePR: number;
7
- docLeft: number;
8
- }
9
- export declare class DocRule {
10
- canvas: HTMLCanvasElement;
11
- viewOptions: ViewOptions;
12
- ss: SelectionState;
13
- private ctx;
14
- private options;
15
- private ruleHeight;
16
- private thumbX;
17
- private mouseDownPos;
18
- private indentThumbPoints;
19
- private hangThumbPoints;
20
- private mouseDownThumbType;
21
- constructor(canvas: HTMLCanvasElement, viewOptions: ViewOptions, ss: SelectionState);
22
- destroy(): void;
23
- setRuleOptions(options: RuleOptions): void;
24
- getParentWidth(): number;
25
- private fillRect;
26
- private drawIndentThumb;
27
- private drawHangThumb;
28
- private measureText;
29
- private drawLine;
30
- private drawText;
31
- /**
32
- * 刷新新的状态
33
- * @param indent
34
- * @param hang
35
- */
36
- refreshRule(): void;
37
- private canvasMousedown;
38
- private getMousePos;
39
- private canvasMousemove;
40
- private canvasMouseup;
41
- private pointInPoly;
42
- /**
43
- * 绘制
44
- */
45
- private drawRule;
46
- private getRuleMarksPos;
47
- private getCurrPara;
48
- private setParentMarksPos;
49
- private drawCellMark;
50
- scaleView(): void;
51
- }
package/dist/doc-ruler.js DELETED
@@ -1,313 +0,0 @@
1
- import { ElementUtil } from "@/med_editor/framework/element-util";
2
- import { DocumentCursor } from "./framework/document-selection";
3
- import { DocumentRenderObject } from "./framework/impl/document/doc-impl";
4
- import { ParagraphElement, ParagraphRenderObject } from "./framework/impl/paragraph/p-impl";
5
- import { TableRowRenderObject } from "./framework/impl/table/table-row-impl";
6
- export class DocRule {
7
- canvas;
8
- viewOptions;
9
- ss;
10
- ctx;
11
- options;
12
- //标尺高度
13
- ruleHeight = 30;
14
- //当前标尺的位置
15
- thumbX;
16
- mouseDownPos;
17
- indentThumbPoints = [];
18
- hangThumbPoints = [];
19
- mouseDownThumbType = 'none';
20
- constructor(canvas, viewOptions, ss) {
21
- this.canvas = canvas;
22
- this.viewOptions = viewOptions;
23
- this.ss = ss;
24
- this.ctx = this.canvas.getContext('2d');
25
- this.options = {
26
- width: 0,
27
- pagePL: 0,
28
- pagePR: 0,
29
- docLeft: 0
30
- };
31
- this.thumbX = {
32
- indent: 0,
33
- hanging: 0
34
- };
35
- this.canvas.addEventListener("mousedown", (evt) => this.canvasMousedown(evt));
36
- this.canvas.addEventListener("mousemove", (evt) => this.canvasMousemove(evt));
37
- this.canvas.addEventListener("mouseup", (evt) => this.canvasMouseup(evt));
38
- }
39
- destroy() {
40
- this.canvas.removeEventListener("mousedown", this.canvasMousedown);
41
- this.canvas.removeEventListener("mousemove", this.canvasMousemove);
42
- this.canvas.removeEventListener("mouseup", this.canvasMouseup);
43
- }
44
- setRuleOptions(options) {
45
- this.options = options;
46
- const convertRatio = this.viewOptions.mmToPixelsRatio;
47
- this.options.pagePL = Math.floor(this.options.pagePL * convertRatio);
48
- this.options.pagePR = Math.floor(this.options.pagePR * convertRatio);
49
- this.scaleView();
50
- ElementUtil.setCanvasProps(this.canvas, this.ctx, { width: this.getParentWidth(), height: this.ruleHeight });
51
- //this.canvas.style.left = this.options.docLeft + 'px';
52
- }
53
- getParentWidth() {
54
- const parent = this.canvas.parentElement;
55
- return parent.getBoundingClientRect().width;
56
- }
57
- fillRect(x, y, width, height, color) {
58
- this.ctx.fillStyle = color;
59
- this.ctx.fillRect(x, y, width, height);
60
- }
61
- drawIndentThumb(x, y) {
62
- const points = [];
63
- x -= 4;
64
- points.push({ x: x, y });
65
- points.push({ x: x, y: y + 3 });
66
- points.push({ x: x + 4, y: y + 7 });
67
- points.push({ x: x + 8, y: y + 3 });
68
- points.push({ x: x + 8, y });
69
- points.push({ x: x, y });
70
- this.drawLine(points);
71
- return points;
72
- }
73
- drawHangThumb(x, y) {
74
- const points = [];
75
- x -= 4;
76
- points.push({ x: x, y });
77
- points.push({ x: x, y: y - 3 });
78
- points.push({ x: x + 4, y: y - 7 });
79
- points.push({ x: x + 8, y: y - 3 });
80
- points.push({ x: x + 8, y });
81
- points.push({ x: x, y });
82
- points.push({ x: x, y: y + 3 });
83
- points.push({ x: x + 8, y: y + 3 });
84
- points.push({ x: x + 8, y: y });
85
- this.drawLine(points);
86
- return points;
87
- }
88
- measureText(text) {
89
- this.ctx.font = "8px 'Times New Roman'";
90
- const measure = this.ctx.measureText(text);
91
- return measure.width;
92
- }
93
- drawLine(points) {
94
- this.ctx.beginPath();
95
- this.ctx.save();
96
- this.ctx.fillStyle = "white";
97
- this.ctx.lineWidth = 0.5;
98
- for (let j = 0; j < points.length; j++) {
99
- let { x, y } = points[j];
100
- x += 0.5;
101
- y += 0.5;
102
- if (j === 0) {
103
- this.ctx.moveTo(x, y);
104
- }
105
- else {
106
- this.ctx.lineTo(x, y);
107
- }
108
- }
109
- this.ctx.stroke();
110
- this.ctx.fill();
111
- this.ctx.closePath();
112
- this.ctx.restore();
113
- }
114
- drawText(text, x, y) {
115
- this.ctx.save();
116
- this.ctx.fillStyle = "rgb(0,0,0)";
117
- this.ctx.textBaseline = "alphabetic";
118
- this.ctx.font = "8px 'Times New Roman'";
119
- this.ctx.fillText(text, x, y + 8 - 1);
120
- this.ctx.restore();
121
- }
122
- /**
123
- * 刷新新的状态
124
- * @param indent
125
- * @param hang
126
- */
127
- refreshRule() {
128
- this.ctx.clearRect(0, 0, this.canvas.width, this.ruleHeight);
129
- this.ctx.save();
130
- this.ctx.translate(this.options.docLeft, 0);
131
- this.drawRule();
132
- this.ctx.restore();
133
- }
134
- canvasMousedown(evt) {
135
- const clickPos = this.getMousePos(evt);
136
- if (this.pointInPoly(clickPos, this.indentThumbPoints)) {
137
- this.mouseDownThumbType = 'indent';
138
- this.mouseDownPos = clickPos;
139
- }
140
- else if (this.pointInPoly(clickPos, this.hangThumbPoints)) {
141
- this.mouseDownThumbType = 'hang';
142
- this.mouseDownPos = clickPos;
143
- }
144
- else {
145
- console.log("未点击在里面");
146
- }
147
- }
148
- getMousePos(evt) {
149
- return {
150
- x: evt.offsetX - this.options.docLeft,
151
- y: evt.offsetY
152
- };
153
- }
154
- canvasMousemove(evt) {
155
- if (['indent', 'hang'].indexOf(this.mouseDownThumbType) < 0) {
156
- return;
157
- }
158
- if (!this.mouseDownPos) {
159
- return;
160
- }
161
- const canvasPos = this.getMousePos(evt);
162
- let moveX = canvasPos.x - this.mouseDownPos.x;
163
- //至少移动5px再进行修改
164
- const remainder = moveX % 5;
165
- if (Math.abs(remainder) < 3) {
166
- return;
167
- }
168
- else {
169
- if (remainder < 0) {
170
- moveX -= 5 + remainder;
171
- }
172
- else {
173
- moveX += 5 - remainder;
174
- }
175
- }
176
- if (moveX === 0) {
177
- return;
178
- }
179
- canvasPos.x = this.mouseDownPos.x + moveX;
180
- const para = this.getCurrPara();
181
- if (!para) {
182
- throw new Error('para is null');
183
- }
184
- if (this.mouseDownThumbType === 'indent') {
185
- this.thumbX.indent += moveX;
186
- this.thumbX.indent = this.thumbX.indent < 0 ? 0 : this.thumbX.indent;
187
- this.thumbX.indent = this.thumbX.indent > this.options.width ? this.options.width : this.thumbX.indent;
188
- this.mouseDownPos = canvasPos;
189
- para.props.indent += moveX;
190
- this.drawRule();
191
- }
192
- if (this.mouseDownThumbType === 'hang') {
193
- this.thumbX.hanging += moveX;
194
- this.thumbX.hanging = this.thumbX.hanging < 0 ? 0 : this.thumbX.hanging;
195
- this.thumbX.hanging = this.thumbX.hanging > this.options.width ? this.options.width : this.thumbX.hanging;
196
- this.mouseDownPos = canvasPos;
197
- para.props.hanging += moveX;
198
- this.drawRule();
199
- }
200
- }
201
- canvasMouseup(evt) {
202
- this.mouseDownThumbType = 'none';
203
- this.mouseDownPos = null;
204
- }
205
- pointInPoly(pt, poly) {
206
- let c = false;
207
- for (let i = -1, l = poly.length, j = l - 1; ++i < l; j = i) {
208
- if (((poly[i].y <= pt.y && pt.y < poly[j].y) || (poly[j].y <= pt.y && pt.y < poly[i].y)) && pt.x < ((poly[j].x - poly[i].x) * (pt.y - poly[i].y)) / (poly[j].y - poly[i].y) + poly[i].x) {
209
- c = !c;
210
- }
211
- }
212
- return c;
213
- }
214
- /**
215
- * 绘制
216
- */
217
- drawRule() {
218
- this.fillRect(0, 0, this.options.pagePL, this.ruleHeight, "rgb(198,198,198)");
219
- this.fillRect(this.options.width - this.options.pagePR, 0, this.options.pagePR, this.ruleHeight, "rgb(198,198,198)");
220
- for (let j = 0; j < 50; j++) {
221
- const gantWidth = 20;
222
- const points = [];
223
- const x = j * gantWidth;
224
- if (x > this.options.width) {
225
- break;
226
- }
227
- const y = 10;
228
- points.push({ x, y }, { x, y: y + 10 });
229
- this.drawLine(points);
230
- const textWidth = this.measureText(j + "");
231
- this.drawText(j + '', x + Math.floor((gantWidth - textWidth) / 2), y + 1);
232
- }
233
- this.getRuleMarksPos();
234
- this.indentThumbPoints = this.drawIndentThumb(this.thumbX.indent, 6);
235
- this.hangThumbPoints = this.drawHangThumb(this.thumbX.hanging, 25);
236
- }
237
- getRuleMarksPos() {
238
- const { startControl, startOffset, startHitInfo } = this.ss;
239
- if (!startControl || !startHitInfo) {
240
- return;
241
- }
242
- const para = ElementUtil.getParentByType(startControl, ParagraphElement);
243
- const indent = para.props.indent;
244
- const hanging = para.props.hanging;
245
- const { startRegion, hitDocIndex } = this.ss.startHitInfo;
246
- const cursorPosi = DocumentCursor.getElementCursorPos(startControl, startOffset, startRegion, hitDocIndex);
247
- //当前段落
248
- const paraRender = ElementUtil.getParentRender(cursorPosi.render, ParagraphRenderObject);
249
- //当前段落位置
250
- const paraRenderPos = ElementUtil.getRenderAbsolutePaintPos(paraRender);
251
- //当前文档
252
- const docRender = ElementUtil.getParentRender(paraRender, DocumentRenderObject);
253
- //当前文档位置
254
- const docRenderPos = ElementUtil.getRenderAbsolutePaintPos(docRender);
255
- this.thumbX.indent = paraRenderPos.x - docRenderPos.x + indent;
256
- this.thumbX.hanging = paraRenderPos.x - docRenderPos.x + hanging;
257
- this.setParentMarksPos(paraRender);
258
- }
259
- getCurrPara() {
260
- const { startControl, startOffset } = this.ss;
261
- if (!startControl) {
262
- return null;
263
- }
264
- return ElementUtil.getParentByType(startControl, ParagraphElement);
265
- }
266
- setParentMarksPos(childRender) {
267
- const items = [];
268
- const parentRender = childRender.parent;
269
- if (!parentRender || parentRender instanceof DocumentRenderObject) {
270
- return items;
271
- }
272
- if (parentRender instanceof TableRowRenderObject) {
273
- const docRender = ElementUtil.getParentRender(parentRender, DocumentRenderObject);
274
- const docRenderPos = ElementUtil.getRenderAbsolutePaintPos(docRender);
275
- for (let i = 0; i < parentRender.length; i++) {
276
- const cellRender = parentRender.getChild(i);
277
- const pos = ElementUtil.getRenderAbsolutePaintPos(cellRender);
278
- this.drawCellMark(pos.x - docRenderPos.x, 0, cellRender.padding.left);
279
- }
280
- }
281
- items.push(...this.setParentMarksPos(parentRender));
282
- return items;
283
- }
284
- drawCellMark(x, y, width) {
285
- x += 0.5;
286
- y += 0.5;
287
- this.fillRect(x, y, width, this.ruleHeight, 'rgb(198,198,198,0.2)');
288
- for (let i = 0; i < width; i++) {
289
- this.ctx.save();
290
- this.ctx.beginPath();
291
- this.ctx.lineWidth = 0.3;
292
- this.ctx.setLineDash([0.5, 0.5, 0.5]);
293
- this.ctx.moveTo(x + i, y);
294
- this.ctx.lineTo(x + i, y + this.ruleHeight);
295
- this.ctx.stroke();
296
- this.ctx.closePath();
297
- this.ctx.restore();
298
- }
299
- }
300
- scaleView() {
301
- return;
302
- const { scale } = this.viewOptions;
303
- //this.canvas.style.transformOrigin = 'center center';
304
- const parent = this.canvas.parentElement;
305
- if (scale === 1) {
306
- parent.style.transform = '';
307
- }
308
- else {
309
- parent.style.transform = `scale(${this.viewOptions.scale})`;
310
- }
311
- }
312
- }
313
- //# sourceMappingURL=doc-ruler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"doc-ruler.js","sourceRoot":"","sources":["../src/med_editor/doc-ruler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAkB,MAAM,gCAAgC,CAAC;AAGhF,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE5F,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAU7E,MAAM,OAAO,OAAO;IAcG;IAAkC;IAAiC;IAb9E,GAAG,CAA4B;IAC/B,OAAO,CAAc;IAC7B,MAAM;IACE,UAAU,GAAG,EAAE,CAAC;IACxB,SAAS;IACD,MAAM,CAGb;IACO,YAAY,CAAmB;IAC/B,iBAAiB,GAAoB,EAAE,CAAC;IACxC,eAAe,GAAoB,EAAE,CAAC;IACtC,kBAAkB,GAA+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AC,SAAS,GAAG,EAAE,CAAC;SAC/B;aAAM;YACH,MAAM,CAAC,KAAK,CAAC,SAAS,GAAG,SAAS,IAAI,CAAC,WAAW,CAAC,KAAK,GAAG,CAAC;SAC/D;IACL,CAAC;CAGJ"}
@@ -1,63 +0,0 @@
1
- import { Rect } from "./element-define";
2
- import { BorderType } from "./render-define";
3
- interface Position {
4
- x: number;
5
- y: number;
6
- }
7
- export declare class CommonUtil {
8
- /**
9
- * 判断坐标是否在矩形框内
10
- * @param rect
11
- * @param position
12
- * @returns
13
- */
14
- static isInsideRectByPosition(rect: Rect, position: Position): boolean;
15
- static isInsideRectByRect(rect: Rect, position: Rect): boolean;
16
- /**
17
- * 判断坐标是否在矩形的边框上
18
- * @param rect
19
- * @param borderWidth
20
- * @param position
21
- */
22
- static isInRectBorder(rect: Rect, borderWidth: number, position: Position): {
23
- borderType: BorderType;
24
- };
25
- /**
26
- * 判断坐标是否在图片的缩放操作点上
27
- */
28
- static isInPictureResizePoint(rect: Rect, pos: Position, r: number): {
29
- borderType: BorderType;
30
- } | null;
31
- /**
32
- * 整形符合连线要求
33
- * @param points
34
- * @param width
35
- * @param strokeColor
36
- */
37
- static resharpPoints(points: Array<Position>): Array<Position>;
38
- static getOffsetX(node: HTMLElement): number;
39
- static randomColor(): string;
40
- /**
41
- * 判断一个数值是否在另一个数值的增益区间中
42
- * @param val
43
- * @param offset
44
- * @param compareValue
45
- * @returns
46
- */
47
- static ApproxmateValueInRange(val: number, offset: number, compareValue: number): boolean;
48
- static getEmptyValue<T>(val: T, emptyVal: T): T;
49
- /**
50
- * 移除并集
51
- * @param array
52
- * @param deleteItems
53
- * @returns
54
- */
55
- static removeUnionSet<T>(array: Array<T>, deleteItems: Array<T>): Array<T>;
56
- static nullToString(val: any): string;
57
- static formatDate(date: Date, format: string): string;
58
- static formatNow(format: string): string;
59
- static parseText(text: string, data: object): string;
60
- static getNowDiffSeconds(date: Date | string): number;
61
- static isDate(str: string): boolean;
62
- }
63
- export {};
@@ -1,178 +0,0 @@
1
- import moment from "moment";
2
- export class CommonUtil {
3
- /**
4
- * 判断坐标是否在矩形框内
5
- * @param rect
6
- * @param position
7
- * @returns
8
- */
9
- static isInsideRectByPosition(rect, position) {
10
- return position.x >= rect.x
11
- &&
12
- position.x <= rect.x + rect.width
13
- &&
14
- position.y >= rect.y
15
- &&
16
- position.y <= rect.y + rect.height;
17
- }
18
- static isInsideRectByRect(rect, position) {
19
- return position.x >= rect.x
20
- &&
21
- position.x <= rect.x + rect.width
22
- &&
23
- position.y >= rect.y
24
- &&
25
- position.y <= rect.y + rect.height
26
- &&
27
- position.y + position.height <= rect.y + rect.height
28
- &&
29
- position.x + position.width <= rect.x + rect.width;
30
- }
31
- /**
32
- * 判断坐标是否在矩形的边框上
33
- * @param rect
34
- * @param borderWidth
35
- * @param position
36
- */
37
- static isInRectBorder(rect, borderWidth, position) {
38
- const leftBorderRect = { x: 0, y: 0, width: borderWidth, height: rect.height, maxWidth: 0, maxHeight: 0 };
39
- const rightBorderRect = { x: rect.width - borderWidth, y: 0, width: borderWidth, height: rect.height, maxWidth: 0, maxHeight: 0 };
40
- const topBorderRect = { x: 0, y: 0, width: rect.width, height: borderWidth, maxWidth: 0, maxHeight: 0 };
41
- const bottomBorderRect = { x: 0, y: rect.height - borderWidth, width: rect.width, height: borderWidth, maxWidth: 0, maxHeight: 0 };
42
- let borderType = 'none';
43
- if (this.isInsideRectByPosition(leftBorderRect, position)) {
44
- borderType = 'left';
45
- }
46
- else if (this.isInsideRectByPosition(rightBorderRect, position)) {
47
- borderType = 'right';
48
- }
49
- else if (this.isInsideRectByPosition(topBorderRect, position)) {
50
- borderType = 'top';
51
- }
52
- else if (this.isInsideRectByPosition(bottomBorderRect, position)) {
53
- borderType = 'bottom';
54
- }
55
- return { borderType };
56
- }
57
- /**
58
- * 判断坐标是否在图片的缩放操作点上
59
- */
60
- static isInPictureResizePoint(rect, pos, r) {
61
- const { width, height } = rect;
62
- const x = 0;
63
- const y = 0;
64
- const points = [{ x, y, type: 'left-top' }, { x: x + width, y, type: 'right-top' }, { x: x + (Math.floor(width / 2)), y: y, type: 'top-middle' }, { x, y: y + Math.floor(height / 2), type: 'left-middle' }, { x, y: y + height, type: 'left-bottom' }, { x: width, y: Math.floor(height / 2), type: 'right-middle' }, { x: x + width, y: y + height, type: 'right-bottom' }, { x: x + (Math.floor(width / 2)), y: y + height, type: 'bottom-middle' }];
65
- for (let i = 0; i < points.length; i++) {
66
- const point = points[i];
67
- const { x: px, y: py } = point;
68
- if (((px - pos.x) * (px - pos.x) + (py - pos.y) * (py - pos.y)) < r * r) {
69
- return { borderType: point.type };
70
- }
71
- }
72
- return null;
73
- }
74
- /**
75
- * 整形符合连线要求
76
- * @param points
77
- * @param width
78
- * @param strokeColor
79
- */
80
- static resharpPoints(points) {
81
- let prevPoint = points[0];
82
- const array = [];
83
- array.push(prevPoint);
84
- for (let i = 1; i < points.length; i++) {
85
- const currPoint = points[i];
86
- //不在同一水平线
87
- if (currPoint.y !== prevPoint.y && currPoint.x !== prevPoint.x) {
88
- array.push({ x: currPoint.x, y: prevPoint.y });
89
- }
90
- array.push(currPoint);
91
- prevPoint = currPoint;
92
- }
93
- return array;
94
- }
95
- static getOffsetX(node) {
96
- if (!node.parentElement) {
97
- throw new Error('node.parentElement is null');
98
- }
99
- const parent = node.parentElement.getBoundingClientRect().left;
100
- const curr = node.getBoundingClientRect().left;
101
- return curr - parent;
102
- }
103
- static randomColor() {
104
- let str = "#";
105
- for (let i = 0; i < 6; i++) {
106
- str += Math.floor(Math.random() * 16).toString(16);
107
- }
108
- return str;
109
- }
110
- /**
111
- * 判断一个数值是否在另一个数值的增益区间中
112
- * @param val
113
- * @param offset
114
- * @param compareValue
115
- * @returns
116
- */
117
- static ApproxmateValueInRange(val, offset, compareValue) {
118
- return (val - offset) <= compareValue && (val + offset) >= compareValue;
119
- }
120
- static getEmptyValue(val, emptyVal) {
121
- if (!val) {
122
- return emptyVal;
123
- }
124
- return val;
125
- }
126
- /**
127
- * 移除并集
128
- * @param array
129
- * @param deleteItems
130
- * @returns
131
- */
132
- static removeUnionSet(array, deleteItems) {
133
- const arraySet = new Set(array);
134
- for (let i = 0; i < deleteItems.length; i++) {
135
- const item = deleteItems[i];
136
- if (arraySet.has(item)) {
137
- arraySet.delete(item);
138
- }
139
- }
140
- return Array.from(arraySet);
141
- }
142
- static nullToString(val) {
143
- if (val === null || val === undefined) {
144
- return '';
145
- }
146
- return val;
147
- }
148
- static formatDate(date, format) {
149
- return moment(date).format(format);
150
- }
151
- static formatNow(format) {
152
- return this.formatDate(new Date(), format);
153
- }
154
- static parseText(text, data) {
155
- const reg = /\{(.*?)\}/g;
156
- let result = text;
157
- let match;
158
- while (match = reg.exec(text)) {
159
- const key = match[1];
160
- const value = data[key];
161
- result = result.replace(match[0], value);
162
- }
163
- return result;
164
- }
165
- //获取和当前日期相差的秒数
166
- static getNowDiffSeconds(date) {
167
- date = typeof date === 'string' ? new Date(date) : date;
168
- const now = new Date();
169
- const diff = now.getTime() - date.getTime();
170
- return diff / 1000;
171
- }
172
- //验证当前字符串是否为日期格式
173
- static isDate(str) {
174
- const reg = /^\d{4}-\d{2}-\d{2}$/;
175
- return reg.test(str);
176
- }
177
- }
178
- //# sourceMappingURL=common-util.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common-util.js","sourceRoot":"","sources":["../../src/med_editor/framework/common-util.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAQ5B,MAAM,OAAO,UAAU;IAEnB;;;;;OAKG;IACH,MAAM,CAAC,sBAAsB,CAAC,IAAU,EAAE,QAAkB;QACxD,OAAO,QAAQ,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC;;gBAEvB,QAAQ,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK;;gBAEjC,QAAQ,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC;;gBAEpB,QAAQ,CAAC,CAAC,IAAI,IA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