eli-video-interview 1.2.42-alpha.33 → 1.2.42-alpha.35

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.
@@ -77,10 +77,10 @@ var measureTextWidth = function (ctx, text) {
77
77
  var width = ctx.measureText(text).width;
78
78
  return width;
79
79
  };
80
- function isInPath(x, y, tx, ty, ctx) {
80
+ function isInPath(x, y, rect, ctx) {
81
81
  var dpr = window.devicePixelRatio || 1;
82
82
  ctx.beginPath();
83
- ctx.arc(tx / dpr, ty / dpr, 10 / dpr, 0, Math.PI * 2, true);
83
+ ctx.rect(0, rect.y / dpr, rect.width / dpr, rect.height / dpr);
84
84
  var ret = ctx.isPointInPath(x, y);
85
85
  ctx.closePath();
86
86
  return ret;
@@ -179,7 +179,6 @@ var draw = function (layout, dimensions, pathRef, ctx) {
179
179
  ctx.font = '16px sans-serif';
180
180
  ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
181
181
  dimensions.forEach(function (v, i) {
182
- var _a;
183
182
  var config = getLevel(v.score);
184
183
  // 绘制圆角矩形
185
184
  var borderRadius = 12;
@@ -190,7 +189,8 @@ var draw = function (layout, dimensions, pathRef, ctx) {
190
189
  drawRoundedRect(x, y, MAX_WIDTH, MAX_HEIGHT, borderRadius, true, false, ctx);
191
190
  var endPointY = 65 + layout.itemSpacing * i;
192
191
  drawLable(v.name, 0, endPointY, ctx);
193
- var score = (_a = v.score) !== null && _a !== void 0 ? _a : (v.score < 4 ? 4 : v.score);
192
+ pathRef.push({ x: 0, y: y, width: layout.leftLableWidth, height: 22, tips: "".concat(v.name, ": ").concat(v.score) });
193
+ var score = v.score === 0 ? 0 : Math.max(v.score, 4);
194
194
  drawScore(layout, ctx, config, {
195
195
  x: layout.leftLableWidth,
196
196
  y: y,
@@ -220,6 +220,12 @@ var Graph = function (_a) {
220
220
  tipEl.style.fontSize = '12px';
221
221
  tipEl.style.display = 'none';
222
222
  document.body.appendChild(tipEl);
223
+ // Clean up the tooltip element when items change
224
+ return function () {
225
+ if (tipEl.parentNode) {
226
+ tipEl.parentNode.removeChild(tipEl);
227
+ }
228
+ };
223
229
  }, [ref, items]);
224
230
  useEffect(function () {
225
231
  if (ctx) {
@@ -237,7 +243,7 @@ var Graph = function (_a) {
237
243
  // }, [pathRef]);
238
244
  var handleMouseMove = useCallback(function (e) {
239
245
  if (ctx) {
240
- var p = pathRef.current.find(function (p) { return isInPath(e.nativeEvent.offsetX, e.nativeEvent.offsetY, p.x, p.y, ctx); });
246
+ var p = pathRef.current.find(function (p) { return isInPath(e.nativeEvent.offsetX, e.nativeEvent.offsetY, p, ctx); });
241
247
  if (p) {
242
248
  tipEl.style.left = e.pageX + 10 + 'px';
243
249
  tipEl.style.top = e.pageY + 10 + 'px';
@@ -81,7 +81,7 @@ var Workplaces = function (_a) {
81
81
  setSuggestionAnswerContent(suggestionAnswer);
82
82
  } }, { children: "\u53D6\u6D88" })), _jsx(Button, __assign({ size: "medium", onClick: handleSubmit }, { children: "\u4FDD\u5B58" }))] }))] }))), internalMode === 'show' && (_jsx(Typography, { variant: "body2", sx: {
83
83
  color: '#424242',
84
- // whiteSpace: 'pre-wrap',
84
+ whiteSpace: 'pre-wrap',
85
85
  }, dangerouslySetInnerHTML: { __html: referenceAnswerContent } }))] }))] }));
86
86
  }
87
87
  else {
@@ -7,22 +7,6 @@ export var PostAiInterviewRefresh = function (orderID) { return POST({ url: "/st
7
7
  export var PostAiInterviewEvaluation = function (data) {
8
8
  return POST({ url: "/standard/b/aiInterview/aiEvaluation/modify", data: data });
9
9
  };
10
- // type RequireOrderTokenIfManualEvaluation<T> = T extends { manualEvaluation: string }
11
- // ? T & { orderToken: string }
12
- // : T;
13
- // type RequireFlowStepTokenIfOtherFields<T> = T extends { scoreManualEvaluation: string } | T extends { suggestionAnswer: string } | T extends { referenceAnswer: string }
14
- // ? T & { flowStepToken: string }
15
- // : T;
16
- // type PostInterviewEvaluationData = {
17
- // manualEvaluation?: string;
18
- // orderToken?: string;
19
- // scoreManualEvaluation?: string;
20
- // suggestionAnswer?: string;
21
- // referenceAnswer?: string;
22
- // };
23
- // type FinalPostInterviewEvaluationData = RequireOrderTokenIfManualEvaluation<
24
- // RequireFlowStepTokenIfOtherFields<PostInterviewEvaluationData>
25
- // >;
26
10
  export var PostInterviewEvaluation = function (data) { return POST({ url: "/standard/b/aiInterview/evaluation/modify", data: data }); };
27
11
  // 更新职场能力回答
28
12
  export var PostAiInterviewWorkplace = function (data) {
@@ -80,10 +80,10 @@ var measureTextWidth = function (ctx, text) {
80
80
  var width = ctx.measureText(text).width;
81
81
  return width;
82
82
  };
83
- function isInPath(x, y, tx, ty, ctx) {
83
+ function isInPath(x, y, rect, ctx) {
84
84
  var dpr = window.devicePixelRatio || 1;
85
85
  ctx.beginPath();
86
- ctx.arc(tx / dpr, ty / dpr, 10 / dpr, 0, Math.PI * 2, true);
86
+ ctx.rect(0, rect.y / dpr, rect.width / dpr, rect.height / dpr);
87
87
  var ret = ctx.isPointInPath(x, y);
88
88
  ctx.closePath();
89
89
  return ret;
@@ -183,7 +183,6 @@ var draw = function (layout, dimensions, pathRef, ctx) {
183
183
  ctx.font = '16px sans-serif';
184
184
  ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
185
185
  dimensions.forEach(function (v, i) {
186
- var _a;
187
186
  var config = getLevel(v.score);
188
187
  // 绘制圆角矩形
189
188
  var borderRadius = 12;
@@ -194,7 +193,8 @@ var draw = function (layout, dimensions, pathRef, ctx) {
194
193
  drawRoundedRect(x, y, MAX_WIDTH, MAX_HEIGHT, borderRadius, true, false, ctx);
195
194
  var endPointY = 65 + layout.itemSpacing * i;
196
195
  drawLable(v.name, 0, endPointY, ctx);
197
- var score = (_a = v.score) !== null && _a !== void 0 ? _a : (v.score < 4 ? 4 : v.score);
196
+ pathRef.push({ x: 0, y: y, width: layout.leftLableWidth, height: 22, tips: "".concat(v.name, ": ").concat(v.score) });
197
+ var score = v.score === 0 ? 0 : Math.max(v.score, 4);
198
198
  drawScore(layout, ctx, config, {
199
199
  x: layout.leftLableWidth,
200
200
  y: y,
@@ -224,6 +224,12 @@ var Graph = function (_a) {
224
224
  tipEl.style.fontSize = '12px';
225
225
  tipEl.style.display = 'none';
226
226
  document.body.appendChild(tipEl);
227
+ // Clean up the tooltip element when items change
228
+ return function () {
229
+ if (tipEl.parentNode) {
230
+ tipEl.parentNode.removeChild(tipEl);
231
+ }
232
+ };
227
233
  }, [ref, items]);
228
234
  (0, react_1.useEffect)(function () {
229
235
  if (ctx) {
@@ -241,7 +247,7 @@ var Graph = function (_a) {
241
247
  // }, [pathRef]);
242
248
  var handleMouseMove = (0, react_1.useCallback)(function (e) {
243
249
  if (ctx) {
244
- var p = pathRef.current.find(function (p) { return isInPath(e.nativeEvent.offsetX, e.nativeEvent.offsetY, p.x, p.y, ctx); });
250
+ var p = pathRef.current.find(function (p) { return isInPath(e.nativeEvent.offsetX, e.nativeEvent.offsetY, p, ctx); });
245
251
  if (p) {
246
252
  tipEl.style.left = e.pageX + 10 + 'px';
247
253
  tipEl.style.top = e.pageY + 10 + 'px';
@@ -83,7 +83,7 @@ var Workplaces = function (_a) {
83
83
  setSuggestionAnswerContent(suggestionAnswer);
84
84
  } }, { children: "\u53D6\u6D88" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ size: "medium", onClick: handleSubmit }, { children: "\u4FDD\u5B58" }))] }))] }))), internalMode === 'show' && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, { variant: "body2", sx: {
85
85
  color: '#424242',
86
- // whiteSpace: 'pre-wrap',
86
+ whiteSpace: 'pre-wrap',
87
87
  }, dangerouslySetInnerHTML: { __html: referenceAnswerContent } }))] }))] }));
88
88
  }
89
89
  else {
@@ -13,22 +13,6 @@ var PostAiInterviewEvaluation = function (data) {
13
13
  return (0, request_1.POST)({ url: "/standard/b/aiInterview/aiEvaluation/modify", data: data });
14
14
  };
15
15
  exports.PostAiInterviewEvaluation = PostAiInterviewEvaluation;
16
- // type RequireOrderTokenIfManualEvaluation<T> = T extends { manualEvaluation: string }
17
- // ? T & { orderToken: string }
18
- // : T;
19
- // type RequireFlowStepTokenIfOtherFields<T> = T extends { scoreManualEvaluation: string } | T extends { suggestionAnswer: string } | T extends { referenceAnswer: string }
20
- // ? T & { flowStepToken: string }
21
- // : T;
22
- // type PostInterviewEvaluationData = {
23
- // manualEvaluation?: string;
24
- // orderToken?: string;
25
- // scoreManualEvaluation?: string;
26
- // suggestionAnswer?: string;
27
- // referenceAnswer?: string;
28
- // };
29
- // type FinalPostInterviewEvaluationData = RequireOrderTokenIfManualEvaluation<
30
- // RequireFlowStepTokenIfOtherFields<PostInterviewEvaluationData>
31
- // >;
32
16
  var PostInterviewEvaluation = function (data) { return (0, request_1.POST)({ url: "/standard/b/aiInterview/evaluation/modify", data: data }); };
33
17
  exports.PostInterviewEvaluation = PostInterviewEvaluation;
34
18
  // 更新职场能力回答
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eli-video-interview",
3
- "version": "1.2.42-alpha.33",
3
+ "version": "1.2.42-alpha.35",
4
4
  "description": "鳄梨科技 AI视频面试 React SDK",
5
5
  "author": "鳄梨科技",
6
6
  "license": "MIT",