@ylzcc/editor 0.8.3 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/editor.es.js CHANGED
@@ -28664,7 +28664,7 @@ const Heading = Node$1.create({
28664
28664
  HTMLAttributes: {
28665
28665
  class: "tiptap-title"
28666
28666
  },
28667
- limitChar: 10,
28667
+ limitChar: 50,
28668
28668
  // 输入的字符个数限制
28669
28669
  onChange: () => {
28670
28670
  },
@@ -127409,17 +127409,22 @@ const HighlightJS = /* @__PURE__ */ getDefaultExportFromCjs(lib), CodeHighlight
127409
127409
  const { data: kh = {}, report: x_, codePlayerConnect: B_, submitActivity: $_ } = Ff, { title: $P = "", topic: zP = "", buttonName: eme = "" } = kh, [tme, nme] = useState(""), [rme, ime] = useState(), [ame, ome] = useState(), sme = () => {
127410
127410
  x_(), cme();
127411
127411
  }, cme = async () => {
127412
- if (!B_)
127413
- return;
127414
- const lme = B_.open();
127415
- lme && (await B_.send(lme, {
127416
- ...kh,
127417
- code: rme ?? (kh == null ? void 0 : kh.code)
127418
- }), B_ == null || B_.listenChange(lme, (ume) => {
127419
- ime(ume), tme || nme("finish");
127420
- }), B_ == null || B_.listenResult(lme, (ume) => {
127421
- nme(ume != null && ume.pass ? "success" : "error");
127422
- }));
127412
+ B_ && B_(
127413
+ {
127414
+ ...kh,
127415
+ code: rme ?? (kh == null ? void 0 : kh.code)
127416
+ },
127417
+ // 当前数据
127418
+ () => {
127419
+ kh.verifyMode && kh.verifyMode != "INPUT_OUTPUT" && tme !== "finish" && nme("finish");
127420
+ },
127421
+ (lme) => {
127422
+ ime(lme), tme || nme("finish");
127423
+ },
127424
+ (lme) => {
127425
+ nme(lme ? "success" : "error");
127426
+ }
127427
+ );
127423
127428
  };
127424
127429
  return useEffect(() => {
127425
127430
  if (!(kh != null && kh.id))
@@ -127434,7 +127439,7 @@ const HighlightJS = /* @__PURE__ */ getDefaultExportFromCjs(lib), CodeHighlight
127434
127439
  }, 2e3);
127435
127440
  ome(lme);
127436
127441
  }, [rme, tme]), useEffect(() => {
127437
- kh != null && kh.topicResult && (nme("finish"), ime(kh == null ? void 0 : kh.topicResult)), kh != null && kh.topicStatus ? nme((kh == null ? void 0 : kh.topicStatus) === "1" ? "success" : "error") : kh != null && kh.topicResult || nme("");
127442
+ (kh == null ? void 0 : kh.topicResult) != null ? (nme("finish"), ime(kh == null ? void 0 : kh.topicResult)) : nme(""), kh != null && kh.topicStatus && nme((kh == null ? void 0 : kh.topicStatus) === "1" ? "success" : "error");
127438
127443
  }, [kh]), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "codetest", contentEditable: !1, children: [
127439
127444
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "title", children: "编码测验" }),
127440
127445
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "codetest-topic", children: zP }),