@mathwiz/ui-components 0.1.28 → 0.1.29
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/components/Button/Button.css +100 -32
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/types.d.ts +19 -0
- package/dist/components/Button/types.d.ts.map +1 -1
- package/dist/components/MathCardV2/modules/SolveModule/SolveModule.d.ts.map +1 -1
- package/dist/components/MathCardV2/scenes/ExplanationScene/ExplanationScene.d.ts.map +1 -1
- package/dist/components/MathCardV2/scenes/QuestionScene/QuestionScene.d.ts.map +1 -1
- package/dist/components/MathCardV2/scenes/SuccessScene/SuccessScene.d.ts.map +1 -1
- package/dist/components/StatBlock/StatBlock.css +331 -0
- package/dist/components/StatBlock/StatBlock.d.ts +7 -0
- package/dist/components/StatBlock/StatBlock.d.ts.map +1 -0
- package/dist/components/StatBlock/index.d.ts +5 -0
- package/dist/components/StatBlock/index.d.ts.map +1 -0
- package/dist/components/StatBlock/types.d.ts +116 -0
- package/dist/components/StatBlock/types.d.ts.map +1 -0
- package/dist/components/Table/Table.d.ts +14 -0
- package/dist/components/Table/Table.d.ts.map +1 -0
- package/dist/components/Table/hooks/useTableCore.d.ts +13 -0
- package/dist/components/Table/hooks/useTableCore.d.ts.map +1 -0
- package/dist/components/Table/hooks/useTableState.d.ts +10 -0
- package/dist/components/Table/hooks/useTableState.d.ts.map +1 -0
- package/dist/components/Table/index.d.ts +7 -0
- package/dist/components/Table/index.d.ts.map +1 -0
- package/dist/components/Table/types.d.ts +179 -0
- package/dist/components/Table/types.d.ts.map +1 -0
- package/dist/components/Table/utils/flattenData.d.ts +15 -0
- package/dist/components/Table/utils/flattenData.d.ts.map +1 -0
- package/dist/components/Table/utils/mergeClass.d.ts +6 -0
- package/dist/components/Table/utils/mergeClass.d.ts.map +1 -0
- package/dist/data/GeometryProblemAdapterV4/jsondata/right-triangle-v4.json +595 -0
- package/dist/data/GeometryProblemAdapterV4/jsondata/triangle-v4-final.json +2 -2
- package/dist/data/TriangleAdapterV3/resolvers/transformRefResolver.d.ts +4 -0
- package/dist/data/TriangleAdapterV3/resolvers/transformRefResolver.d.ts.map +1 -1
- package/dist/data/TriangleAdapterV3/transformers/geometryTransformTransformer.d.ts.map +1 -1
- package/dist/index.cjs +13 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +309 -237
- package/dist/index.mjs.map +1 -1
- package/dist/mathwiz-ui.css +1 -1
- package/dist/pages/GradeUnitBrowserPage/GradeUnitBrowserPage.d.ts.map +1 -1
- package/dist/pages/MathSessionPage/MathSessionPage.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/styles/index.css +34 -0
- package/package.json +5 -3
package/dist/index.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import { create as Lt } from "zustand";
|
|
|
11
11
|
import { useShallow as fo } from "zustand/shallow";
|
|
12
12
|
import { useShallow as on } from "zustand/react/shallow";
|
|
13
13
|
import { devtools as Hs } from "zustand/middleware";
|
|
14
|
-
const
|
|
14
|
+
const tt = ({
|
|
15
15
|
progress: r,
|
|
16
16
|
variant: e = "solid",
|
|
17
17
|
size: t = "md",
|
|
@@ -19,25 +19,31 @@ const Ot = ({
|
|
|
19
19
|
children: o,
|
|
20
20
|
className: s = "",
|
|
21
21
|
loading: i,
|
|
22
|
-
|
|
22
|
+
intent: a,
|
|
23
|
+
useNewClassName: c = !1,
|
|
24
|
+
...l
|
|
23
25
|
}) => {
|
|
24
|
-
const
|
|
25
|
-
"button"
|
|
26
|
-
`
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
const u = r !== void 0 ? ((g) => {
|
|
27
|
+
const p = c ? "mathwiz-btn--" : "button--";
|
|
28
|
+
return g === 0 ? `${p}primary` : g === 100 ? `${p}success` : `${p}secondary`;
|
|
29
|
+
})(r) : c ? "mathwiz-btn--primary" : "button--primary", y = c ? "mathwiz-btn" : "button", m = c ? "mathwiz-btn--" : "button--", h = [
|
|
30
|
+
y,
|
|
31
|
+
`${m}${t}`,
|
|
32
|
+
`${m}${e}`,
|
|
33
|
+
`${m}radius-${n}`,
|
|
34
|
+
u,
|
|
35
|
+
i && `${m}loading`,
|
|
36
|
+
a && c ? `mathwiz-btn--${a}` : null,
|
|
31
37
|
s
|
|
32
38
|
].filter(Boolean).join(" ");
|
|
33
39
|
return /* @__PURE__ */ f(
|
|
34
40
|
"button",
|
|
35
41
|
{
|
|
36
42
|
type: "button",
|
|
37
|
-
className:
|
|
43
|
+
className: h,
|
|
38
44
|
"data-progress": r,
|
|
39
|
-
disabled: i ||
|
|
40
|
-
...
|
|
45
|
+
disabled: i || l.disabled,
|
|
46
|
+
...l,
|
|
41
47
|
children: i ? "加载中..." : o
|
|
42
48
|
}
|
|
43
49
|
);
|
|
@@ -75,7 +81,7 @@ const Ot = ({
|
|
|
75
81
|
] })
|
|
76
82
|
] }),
|
|
77
83
|
/* @__PURE__ */ f(
|
|
78
|
-
|
|
84
|
+
tt,
|
|
79
85
|
{
|
|
80
86
|
size: "sm",
|
|
81
87
|
radius: "md",
|
|
@@ -326,9 +332,9 @@ function mo(r, e) {
|
|
|
326
332
|
const { toString: ti } = Object.prototype, { getPrototypeOf: sn } = Object, { iterator: wr, toStringTag: ho } = Symbol, Ar = /* @__PURE__ */ ((r) => (e) => {
|
|
327
333
|
const t = ti.call(e);
|
|
328
334
|
return r[t] || (r[t] = t.slice(8, -1).toLowerCase());
|
|
329
|
-
})(/* @__PURE__ */ Object.create(null)), Ue = (r) => (r = r.toLowerCase(), (e) => Ar(e) === r), Rr = (r) => (e) => typeof e === r, { isArray:
|
|
335
|
+
})(/* @__PURE__ */ Object.create(null)), Ue = (r) => (r = r.toLowerCase(), (e) => Ar(e) === r), Rr = (r) => (e) => typeof e === r, { isArray: xt } = Array, _t = Rr("undefined");
|
|
330
336
|
function Ut(r) {
|
|
331
|
-
return r !== null && !
|
|
337
|
+
return r !== null && !_t(r) && r.constructor !== null && !_t(r.constructor) && Ne(r.constructor.isBuffer) && r.constructor.isBuffer(r);
|
|
332
338
|
}
|
|
333
339
|
const go = Ue("ArrayBuffer");
|
|
334
340
|
function ri(r) {
|
|
@@ -362,7 +368,7 @@ function zt(r, e, { allOwnKeys: t = !1 } = {}) {
|
|
|
362
368
|
if (r === null || typeof r > "u")
|
|
363
369
|
return;
|
|
364
370
|
let n, o;
|
|
365
|
-
if (typeof r != "object" && (r = [r]),
|
|
371
|
+
if (typeof r != "object" && (r = [r]), xt(r))
|
|
366
372
|
for (n = 0, o = r.length; n < o; n++)
|
|
367
373
|
e.call(null, r[n], n, r);
|
|
368
374
|
else {
|
|
@@ -385,13 +391,13 @@ function yo(r, e) {
|
|
|
385
391
|
return o;
|
|
386
392
|
return null;
|
|
387
393
|
}
|
|
388
|
-
const
|
|
394
|
+
const dt = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, bo = (r) => !_t(r) && r !== dt;
|
|
389
395
|
function qr() {
|
|
390
396
|
const { caseless: r, skipUndefined: e } = bo(this) && this || {}, t = {}, n = (o, s) => {
|
|
391
397
|
if (s === "__proto__" || s === "constructor" || s === "prototype")
|
|
392
398
|
return;
|
|
393
399
|
const i = r && yo(t, s) || s;
|
|
394
|
-
ar(t[i]) && ar(o) ? t[i] = qr(t[i], o) : ar(o) ? t[i] = qr({}, o) :
|
|
400
|
+
ar(t[i]) && ar(o) ? t[i] = qr(t[i], o) : ar(o) ? t[i] = qr({}, o) : xt(o) ? t[i] = o.slice() : (!e || !_t(o)) && (t[i] = o);
|
|
395
401
|
};
|
|
396
402
|
for (let o = 0, s = arguments.length; o < s; o++)
|
|
397
403
|
arguments[o] && zt(arguments[o], n);
|
|
@@ -441,7 +447,7 @@ const bi = (r, e, t, { allOwnKeys: n } = {}) => (zt(
|
|
|
441
447
|
return n !== -1 && n === t;
|
|
442
448
|
}, Ri = (r) => {
|
|
443
449
|
if (!r) return null;
|
|
444
|
-
if (
|
|
450
|
+
if (xt(r)) return r;
|
|
445
451
|
let e = r.length;
|
|
446
452
|
if (!po(e)) return null;
|
|
447
453
|
const t = new Array(e);
|
|
@@ -490,7 +496,7 @@ const bi = (r, e, t, { allOwnKeys: n } = {}) => (zt(
|
|
|
490
496
|
t[s] = !0;
|
|
491
497
|
});
|
|
492
498
|
};
|
|
493
|
-
return
|
|
499
|
+
return xt(r) ? n(r) : n(String(r).split(e)), t;
|
|
494
500
|
}, Oi = () => {
|
|
495
501
|
}, Ii = (r, e) => r != null && Number.isFinite(r = +r) ? r : e;
|
|
496
502
|
function Mi(r) {
|
|
@@ -505,26 +511,26 @@ const Fi = (r) => {
|
|
|
505
511
|
return n;
|
|
506
512
|
if (!("toJSON" in n)) {
|
|
507
513
|
e[o] = n;
|
|
508
|
-
const s =
|
|
514
|
+
const s = xt(n) ? [] : {};
|
|
509
515
|
return zt(n, (i, a) => {
|
|
510
516
|
const c = t(i, o + 1);
|
|
511
|
-
!
|
|
517
|
+
!_t(c) && (s[a] = c);
|
|
512
518
|
}), e[o] = void 0, s;
|
|
513
519
|
}
|
|
514
520
|
}
|
|
515
521
|
return n;
|
|
516
522
|
};
|
|
517
523
|
return t(r, 0);
|
|
518
|
-
}, Pi = Ue("AsyncFunction"), Di = (r) => r && (Gt(r) || Ne(r)) && Ne(r.then) && Ne(r.catch), _o = ((r, e) => r ? setImmediate : e ? ((t, n) => (
|
|
524
|
+
}, Pi = Ue("AsyncFunction"), Di = (r) => r && (Gt(r) || Ne(r)) && Ne(r.then) && Ne(r.catch), _o = ((r, e) => r ? setImmediate : e ? ((t, n) => (dt.addEventListener(
|
|
519
525
|
"message",
|
|
520
526
|
({ source: o, data: s }) => {
|
|
521
|
-
o ===
|
|
527
|
+
o === dt && s === t && n.length && n.shift()();
|
|
522
528
|
},
|
|
523
529
|
!1
|
|
524
530
|
), (o) => {
|
|
525
|
-
n.push(o),
|
|
526
|
-
}))(`axios@${Math.random()}`, []) : (t) => setTimeout(t))(typeof setImmediate == "function", Ne(
|
|
527
|
-
isArray:
|
|
531
|
+
n.push(o), dt.postMessage(t, "*");
|
|
532
|
+
}))(`axios@${Math.random()}`, []) : (t) => setTimeout(t))(typeof setImmediate == "function", Ne(dt.postMessage)), Li = typeof queueMicrotask < "u" ? queueMicrotask.bind(dt) : typeof process < "u" && process.nextTick || _o, Ui = (r) => r != null && Ne(r[wr]), _ = {
|
|
533
|
+
isArray: xt,
|
|
528
534
|
isArrayBuffer: go,
|
|
529
535
|
isBuffer: Ut,
|
|
530
536
|
isFormData: fi,
|
|
@@ -539,7 +545,7 @@ const Fi = (r) => {
|
|
|
539
545
|
isRequest: hi,
|
|
540
546
|
isResponse: gi,
|
|
541
547
|
isHeaders: pi,
|
|
542
|
-
isUndefined:
|
|
548
|
+
isUndefined: _t,
|
|
543
549
|
isDate: ii,
|
|
544
550
|
isFile: ai,
|
|
545
551
|
isBlob: li,
|
|
@@ -573,7 +579,7 @@ const Fi = (r) => {
|
|
|
573
579
|
noop: Oi,
|
|
574
580
|
toFiniteNumber: Ii,
|
|
575
581
|
findKey: yo,
|
|
576
|
-
global:
|
|
582
|
+
global: dt,
|
|
577
583
|
isContextDefined: bo,
|
|
578
584
|
isSpecCompliantForm: Mi,
|
|
579
585
|
toJSONObject: Fi,
|
|
@@ -980,7 +986,7 @@ const ra = _.toObjectSet([
|
|
|
980
986
|
o = i.indexOf(":"), t = i.substring(0, o).trim().toLowerCase(), n = i.substring(o + 1).trim(), !(!t || e[t] && ra[t]) && (t === "set-cookie" ? e[t] ? e[t].push(n) : e[t] = [n] : e[t] = e[t] ? e[t] + ", " + n : n);
|
|
981
987
|
}), e;
|
|
982
988
|
}, Nn = /* @__PURE__ */ Symbol("internals");
|
|
983
|
-
function
|
|
989
|
+
function Nt(r) {
|
|
984
990
|
return r && String(r).trim().toLowerCase();
|
|
985
991
|
}
|
|
986
992
|
function lr(r) {
|
|
@@ -1025,7 +1031,7 @@ let $e = class {
|
|
|
1025
1031
|
set(e, t, n) {
|
|
1026
1032
|
const o = this;
|
|
1027
1033
|
function s(a, c, l) {
|
|
1028
|
-
const d =
|
|
1034
|
+
const d = Nt(c);
|
|
1029
1035
|
if (!d)
|
|
1030
1036
|
throw new Error("header name must be a non-empty string");
|
|
1031
1037
|
const u = _.findKey(o, d);
|
|
@@ -1049,7 +1055,7 @@ let $e = class {
|
|
|
1049
1055
|
return this;
|
|
1050
1056
|
}
|
|
1051
1057
|
get(e, t) {
|
|
1052
|
-
if (e =
|
|
1058
|
+
if (e = Nt(e), e) {
|
|
1053
1059
|
const n = _.findKey(this, e);
|
|
1054
1060
|
if (n) {
|
|
1055
1061
|
const o = this[n];
|
|
@@ -1066,7 +1072,7 @@ let $e = class {
|
|
|
1066
1072
|
}
|
|
1067
1073
|
}
|
|
1068
1074
|
has(e, t) {
|
|
1069
|
-
if (e =
|
|
1075
|
+
if (e = Nt(e), e) {
|
|
1070
1076
|
const n = _.findKey(this, e);
|
|
1071
1077
|
return !!(n && this[n] !== void 0 && (!t || Mr(this, this[n], n, t)));
|
|
1072
1078
|
}
|
|
@@ -1076,7 +1082,7 @@ let $e = class {
|
|
|
1076
1082
|
const n = this;
|
|
1077
1083
|
let o = !1;
|
|
1078
1084
|
function s(i) {
|
|
1079
|
-
if (i =
|
|
1085
|
+
if (i = Nt(i), i) {
|
|
1080
1086
|
const a = _.findKey(n, i);
|
|
1081
1087
|
a && (!t || Mr(n, n[a], a, t)) && (delete n[a], o = !0);
|
|
1082
1088
|
}
|
|
@@ -1138,7 +1144,7 @@ let $e = class {
|
|
|
1138
1144
|
accessors: {}
|
|
1139
1145
|
}).accessors, o = this.prototype;
|
|
1140
1146
|
function s(i) {
|
|
1141
|
-
const a =
|
|
1147
|
+
const a = Nt(i);
|
|
1142
1148
|
n[a] || (aa(o, i), n[a] = !0);
|
|
1143
1149
|
}
|
|
1144
1150
|
return _.isArray(e) ? e.forEach(s) : s(e), this;
|
|
@@ -1290,7 +1296,7 @@ function To(r, e, t) {
|
|
|
1290
1296
|
return r && (n || t == !1) ? ha(r, e) : e;
|
|
1291
1297
|
}
|
|
1292
1298
|
const On = (r) => r instanceof $e ? { ...r } : r;
|
|
1293
|
-
function
|
|
1299
|
+
function ut(r, e) {
|
|
1294
1300
|
e = e || {};
|
|
1295
1301
|
const t = {};
|
|
1296
1302
|
function n(l, d, u, y) {
|
|
@@ -1360,7 +1366,7 @@ function ft(r, e) {
|
|
|
1360
1366
|
), t;
|
|
1361
1367
|
}
|
|
1362
1368
|
const No = (r) => {
|
|
1363
|
-
const e =
|
|
1369
|
+
const e = ut({}, r);
|
|
1364
1370
|
let { data: t, withXSRFToken: n, xsrfHeaderName: o, xsrfCookieName: s, headers: i, auth: a } = e;
|
|
1365
1371
|
if (e.headers = i = $e.from(i), e.url = xo(To(e.baseURL, e.url, e.allowAbsoluteUrls), r.params, r.paramsSerializer), a && i.set(
|
|
1366
1372
|
"Authorization",
|
|
@@ -1627,8 +1633,8 @@ const No = (r) => {
|
|
|
1627
1633
|
const q = d && (A === "stream" || A === "response");
|
|
1628
1634
|
if (d && (w || q && U)) {
|
|
1629
1635
|
const ue = {};
|
|
1630
|
-
["status", "statusText", "headers"].forEach((
|
|
1631
|
-
ue[
|
|
1636
|
+
["status", "statusText", "headers"].forEach((rt) => {
|
|
1637
|
+
ue[rt] = le[rt];
|
|
1632
1638
|
});
|
|
1633
1639
|
const _e = _.toFiniteNumber(le.headers.get("content-length")), [Oe, Je] = w && $n(
|
|
1634
1640
|
_e,
|
|
@@ -1803,7 +1809,7 @@ const cr = {
|
|
|
1803
1809
|
assertOptions: Ca,
|
|
1804
1810
|
validators: Sr
|
|
1805
1811
|
}, Pe = cr.validators;
|
|
1806
|
-
let
|
|
1812
|
+
let ft = class {
|
|
1807
1813
|
constructor(e) {
|
|
1808
1814
|
this.defaults = e || {}, this.interceptors = {
|
|
1809
1815
|
request: new Tn(),
|
|
@@ -1836,7 +1842,7 @@ let dt = class {
|
|
|
1836
1842
|
}
|
|
1837
1843
|
}
|
|
1838
1844
|
_request(e, t) {
|
|
1839
|
-
typeof e == "string" ? (t = t || {}, t.url = e) : t = e || {}, t =
|
|
1845
|
+
typeof e == "string" ? (t = t || {}, t.url = e) : t = e || {}, t = ut(this.defaults, t);
|
|
1840
1846
|
const { transitional: n, paramsSerializer: o, headers: s } = t;
|
|
1841
1847
|
n !== void 0 && cr.assertOptions(n, {
|
|
1842
1848
|
silentJSONParsing: Pe.transitional(Pe.boolean),
|
|
@@ -1903,14 +1909,14 @@ let dt = class {
|
|
|
1903
1909
|
return d;
|
|
1904
1910
|
}
|
|
1905
1911
|
getUri(e) {
|
|
1906
|
-
e =
|
|
1912
|
+
e = ut(this.defaults, e);
|
|
1907
1913
|
const t = To(e.baseURL, e.url, e.allowAbsoluteUrls);
|
|
1908
1914
|
return xo(t, e.params, e.paramsSerializer);
|
|
1909
1915
|
}
|
|
1910
1916
|
};
|
|
1911
1917
|
_.forEach(["delete", "get", "head", "options"], function(e) {
|
|
1912
|
-
|
|
1913
|
-
return this.request(
|
|
1918
|
+
ft.prototype[e] = function(t, n) {
|
|
1919
|
+
return this.request(ut(n || {}, {
|
|
1914
1920
|
method: e,
|
|
1915
1921
|
url: t,
|
|
1916
1922
|
data: (n || {}).data
|
|
@@ -1920,7 +1926,7 @@ _.forEach(["delete", "get", "head", "options"], function(e) {
|
|
|
1920
1926
|
_.forEach(["post", "put", "patch"], function(e) {
|
|
1921
1927
|
function t(n) {
|
|
1922
1928
|
return function(s, i, a) {
|
|
1923
|
-
return this.request(
|
|
1929
|
+
return this.request(ut(a || {}, {
|
|
1924
1930
|
method: e,
|
|
1925
1931
|
headers: n ? {
|
|
1926
1932
|
"Content-Type": "multipart/form-data"
|
|
@@ -1930,7 +1936,7 @@ _.forEach(["post", "put", "patch"], function(e) {
|
|
|
1930
1936
|
}));
|
|
1931
1937
|
};
|
|
1932
1938
|
}
|
|
1933
|
-
|
|
1939
|
+
ft.prototype[e] = t(), ft.prototype[e + "Form"] = t(!0);
|
|
1934
1940
|
});
|
|
1935
1941
|
let Ea = class Io {
|
|
1936
1942
|
constructor(e) {
|
|
@@ -2088,13 +2094,13 @@ Object.entries(Kr).forEach(([r, e]) => {
|
|
|
2088
2094
|
Kr[e] = r;
|
|
2089
2095
|
});
|
|
2090
2096
|
function Mo(r) {
|
|
2091
|
-
const e = new
|
|
2092
|
-
return _.extend(t,
|
|
2093
|
-
return Mo(
|
|
2097
|
+
const e = new ft(r), t = mo(ft.prototype.request, e);
|
|
2098
|
+
return _.extend(t, ft.prototype, e, { allOwnKeys: !0 }), _.extend(t, e, null, { allOwnKeys: !0 }), t.create = function(o) {
|
|
2099
|
+
return Mo(ut(r, o));
|
|
2094
2100
|
}, t;
|
|
2095
2101
|
}
|
|
2096
2102
|
const ae = Mo(jt);
|
|
2097
|
-
ae.Axios =
|
|
2103
|
+
ae.Axios = ft;
|
|
2098
2104
|
ae.CanceledError = Bt;
|
|
2099
2105
|
ae.CancelToken = Ea;
|
|
2100
2106
|
ae.isCancel = Co;
|
|
@@ -2107,7 +2113,7 @@ ae.all = function(e) {
|
|
|
2107
2113
|
};
|
|
2108
2114
|
ae.spread = Ta;
|
|
2109
2115
|
ae.isAxiosError = Na;
|
|
2110
|
-
ae.mergeConfig =
|
|
2116
|
+
ae.mergeConfig = ut;
|
|
2111
2117
|
ae.AxiosHeaders = $e;
|
|
2112
2118
|
ae.formToJSON = (r) => So(_.isHTMLForm(r) ? new FormData(r) : r);
|
|
2113
2119
|
ae.getAdapter = ko.getAdapter;
|
|
@@ -2428,10 +2434,10 @@ import 'katex/dist/katex.min.css';
|
|
|
2428
2434
|
);
|
|
2429
2435
|
}
|
|
2430
2436
|
);
|
|
2431
|
-
function
|
|
2437
|
+
function kt(r) {
|
|
2432
2438
|
return r.type !== "composite";
|
|
2433
2439
|
}
|
|
2434
|
-
function
|
|
2440
|
+
function Ot(r) {
|
|
2435
2441
|
return r.type === "composite";
|
|
2436
2442
|
}
|
|
2437
2443
|
function Ga() {
|
|
@@ -2443,13 +2449,13 @@ function Ga() {
|
|
|
2443
2449
|
}
|
|
2444
2450
|
};
|
|
2445
2451
|
}
|
|
2446
|
-
function
|
|
2452
|
+
function wt(r) {
|
|
2447
2453
|
if (!r)
|
|
2448
2454
|
return Ga();
|
|
2449
2455
|
if (r.type === "composite" && Array.isArray(r.transforms))
|
|
2450
2456
|
return {
|
|
2451
2457
|
type: "composite",
|
|
2452
|
-
transforms: r.transforms.map((s) =>
|
|
2458
|
+
transforms: r.transforms.map((s) => wt(s)),
|
|
2453
2459
|
executionMode: r.executionMode || "sequential"
|
|
2454
2460
|
};
|
|
2455
2461
|
if (r.type && r.config)
|
|
@@ -2458,7 +2464,7 @@ function _t(r) {
|
|
|
2458
2464
|
if (e.type === "composite" && Array.isArray(e.composite))
|
|
2459
2465
|
return {
|
|
2460
2466
|
type: "composite",
|
|
2461
|
-
transforms: e.composite.map((s, i) =>
|
|
2467
|
+
transforms: e.composite.map((s, i) => wt(s)),
|
|
2462
2468
|
executionMode: "sequential"
|
|
2463
2469
|
// 默认顺序执行
|
|
2464
2470
|
};
|
|
@@ -2476,7 +2482,7 @@ const Er = (r) => {
|
|
|
2476
2482
|
e += n, t += o;
|
|
2477
2483
|
return [e / r.length, t / r.length];
|
|
2478
2484
|
}, Xr = (r) => {
|
|
2479
|
-
if (
|
|
2485
|
+
if (kt(r)) {
|
|
2480
2486
|
const e = r;
|
|
2481
2487
|
if (!e.config)
|
|
2482
2488
|
return `${e.type}变换缺少配置`;
|
|
@@ -2496,7 +2502,7 @@ const Er = (r) => {
|
|
|
2496
2502
|
}
|
|
2497
2503
|
return null;
|
|
2498
2504
|
}
|
|
2499
|
-
if (
|
|
2505
|
+
if (Ot(r)) {
|
|
2500
2506
|
const e = r;
|
|
2501
2507
|
if (!e.transforms)
|
|
2502
2508
|
return "复合变换缺少transforms字段";
|
|
@@ -2517,7 +2523,7 @@ const Er = (r) => {
|
|
|
2517
2523
|
return `全局变换配置错误: ${o}`;
|
|
2518
2524
|
for (const s of t.animated)
|
|
2519
2525
|
if (s.transform) {
|
|
2520
|
-
const i =
|
|
2526
|
+
const i = wt(s.transform), a = Xr(i);
|
|
2521
2527
|
if (a)
|
|
2522
2528
|
return `形状"${s.metadata?.id || "未知"}"专属变换配置错误: ${a}`;
|
|
2523
2529
|
}
|
|
@@ -2534,7 +2540,7 @@ const Er = (r) => {
|
|
|
2534
2540
|
}
|
|
2535
2541
|
return null;
|
|
2536
2542
|
}, ja = (r) => {
|
|
2537
|
-
const { base: e, height: t, shapes: n, transform: o } = r, s =
|
|
2543
|
+
const { base: e, height: t, shapes: n, transform: o } = r, s = wt(o), i = za(e, t, n, s);
|
|
2538
2544
|
return i ? {
|
|
2539
2545
|
code: "INVALID_CONFIG",
|
|
2540
2546
|
message: i,
|
|
@@ -3137,9 +3143,9 @@ class rl {
|
|
|
3137
3143
|
return this.executors.size;
|
|
3138
3144
|
}
|
|
3139
3145
|
}
|
|
3140
|
-
let
|
|
3146
|
+
let st = null;
|
|
3141
3147
|
function Po() {
|
|
3142
|
-
return
|
|
3148
|
+
return st || (st = new rl(), st.register(new Xa()), st.register(new Ja()), st.register(new Za()), st.register(new tl())), st;
|
|
3143
3149
|
}
|
|
3144
3150
|
class Zr {
|
|
3145
3151
|
/**
|
|
@@ -3483,7 +3489,7 @@ class sl {
|
|
|
3483
3489
|
if (!n)
|
|
3484
3490
|
return e;
|
|
3485
3491
|
const s = Zr.extractGroupId(o, "rotationGroup");
|
|
3486
|
-
return
|
|
3492
|
+
return kt(n) ? this.executeSingleTransform(e, t, n, o, s) : Ot(n) ? this.compositor.execute(e, t, n, s, o) : (console.error("未知的变换类型:", n), e);
|
|
3487
3493
|
}
|
|
3488
3494
|
/**
|
|
3489
3495
|
* 获取有效的变换配置(处理形状专属transform的优先级)
|
|
@@ -3500,12 +3506,12 @@ class sl {
|
|
|
3500
3506
|
* @returns 变换信息
|
|
3501
3507
|
*/
|
|
3502
3508
|
getTransformInfo(e) {
|
|
3503
|
-
return e ?
|
|
3509
|
+
return e ? kt(e) ? {
|
|
3504
3510
|
count: 1,
|
|
3505
3511
|
types: [e.type],
|
|
3506
3512
|
groups: e.targetGroup ? [e.targetGroup] : [],
|
|
3507
3513
|
hasTransform: !0
|
|
3508
|
-
} :
|
|
3514
|
+
} : Ot(e) ? {
|
|
3509
3515
|
...this.compositor.getTransformInfo(e),
|
|
3510
3516
|
hasTransform: !0
|
|
3511
3517
|
} : {
|
|
@@ -3526,7 +3532,7 @@ class sl {
|
|
|
3526
3532
|
* @returns 验证结果
|
|
3527
3533
|
*/
|
|
3528
3534
|
validateTransform(e) {
|
|
3529
|
-
return e ?
|
|
3535
|
+
return e ? kt(e) ? this.validateSingleTransform(e) : Ot(e) ? this.compositor.validate(e) : {
|
|
3530
3536
|
isValid: !1,
|
|
3531
3537
|
errors: ["未知的变换类型"],
|
|
3532
3538
|
warnings: []
|
|
@@ -3542,7 +3548,7 @@ class sl {
|
|
|
3542
3548
|
* @returns 是否为空变换
|
|
3543
3549
|
*/
|
|
3544
3550
|
isEmptyTransform(e) {
|
|
3545
|
-
return e ?
|
|
3551
|
+
return e ? kt(e) ? !1 : Ot(e) ? this.compositor.isEmpty(e) : !0 : !0;
|
|
3546
3552
|
}
|
|
3547
3553
|
/**
|
|
3548
3554
|
* 批量执行多个形状的变换
|
|
@@ -3674,7 +3680,7 @@ const il = () => {
|
|
|
3674
3680
|
width: 800,
|
|
3675
3681
|
height: 560
|
|
3676
3682
|
}), U = W(() => new sl(), []), re = W(
|
|
3677
|
-
() =>
|
|
3683
|
+
() => wt(a),
|
|
3678
3684
|
[a]
|
|
3679
3685
|
), I = Te(null), ve = Te({}), le = Te(null), {
|
|
3680
3686
|
handleProgressChange: q,
|
|
@@ -3713,7 +3719,7 @@ const il = () => {
|
|
|
3713
3719
|
const Je = {
|
|
3714
3720
|
width: g ?? `${J.width}px`,
|
|
3715
3721
|
height: `${J.height}px`
|
|
3716
|
-
},
|
|
3722
|
+
}, rt = V((N, E) => {
|
|
3717
3723
|
console.log("🔍 computeDynamicAppearance called:", {
|
|
3718
3724
|
shapeId: N.metadata?.id,
|
|
3719
3725
|
shapeType: N.type,
|
|
@@ -3729,12 +3735,12 @@ const il = () => {
|
|
|
3729
3735
|
if (yr(ce) && (!ze || yr(ze))) {
|
|
3730
3736
|
let Me = E;
|
|
3731
3737
|
E < pe ? Me = 0 : E > we ? Me = 1 : Me = (E - pe) / (we - pe);
|
|
3732
|
-
const
|
|
3733
|
-
ne = Fo(
|
|
3738
|
+
const Tt = ze || Z.fillColor || "#FFFFFF";
|
|
3739
|
+
ne = Fo(Tt, ce, Me, Ie), console.log("🎨 fillcolor_set applied:", {
|
|
3734
3740
|
shapeId: N.metadata?.id,
|
|
3735
3741
|
progress: E,
|
|
3736
3742
|
effectiveProgress: Me,
|
|
3737
|
-
startColor:
|
|
3743
|
+
startColor: Tt,
|
|
3738
3744
|
targetColor: ce,
|
|
3739
3745
|
resultColor: ne
|
|
3740
3746
|
});
|
|
@@ -3758,21 +3764,21 @@ const il = () => {
|
|
|
3758
3764
|
}
|
|
3759
3765
|
return 1;
|
|
3760
3766
|
}, G = { ...Z };
|
|
3761
|
-
let
|
|
3762
|
-
const Ge = F(R.visibility),
|
|
3767
|
+
let nt = !0;
|
|
3768
|
+
const Ge = F(R.visibility), ot = F(R.labelVisibility);
|
|
3763
3769
|
if (console.log("📊 Visibility values:", {
|
|
3764
3770
|
shapeId: N.metadata?.id,
|
|
3765
3771
|
progress: E,
|
|
3766
3772
|
visibilityValue: Ge,
|
|
3767
|
-
labelVisibilityValue:
|
|
3773
|
+
labelVisibilityValue: ot,
|
|
3768
3774
|
hasVisibility: !!R.visibility,
|
|
3769
3775
|
hasLabelVisibility: !!R.labelVisibility
|
|
3770
|
-
}), R.visibility && (G.fillOpacity === void 0 && (G.fillOpacity = 1), G.fillOpacity *= Ge, Ge === 0 && (G.strokeWidth = 0, console.log("👁️ Shape hidden, strokeWidth set to 0")), G.strokeColor,
|
|
3771
|
-
const oe =
|
|
3776
|
+
}), R.visibility && (G.fillOpacity === void 0 && (G.fillOpacity = 1), G.fillOpacity *= Ge, Ge === 0 && (G.strokeWidth = 0, console.log("👁️ Shape hidden, strokeWidth set to 0")), G.strokeColor, nt = Ge > 0, console.log("👁️ Shape visibility:", { shapeId: N.metadata?.id, visible: nt, visibilityValue: Ge })), R.labelVisibility) {
|
|
3777
|
+
const oe = ot > 0;
|
|
3772
3778
|
G.labelVisible = oe, console.log("🏷️ Label visibility:", {
|
|
3773
3779
|
shapeId: N.metadata?.id,
|
|
3774
3780
|
labelVisible: oe,
|
|
3775
|
-
labelVisibilityValue:
|
|
3781
|
+
labelVisibilityValue: ot,
|
|
3776
3782
|
hasLabel: !!N.metadata?.label
|
|
3777
3783
|
});
|
|
3778
3784
|
}
|
|
@@ -3784,8 +3790,8 @@ const il = () => {
|
|
|
3784
3790
|
else if (E > pe)
|
|
3785
3791
|
Me = Ie;
|
|
3786
3792
|
else {
|
|
3787
|
-
const
|
|
3788
|
-
Me = we + (Ie - we) *
|
|
3793
|
+
const Tt = (E - ce) / (pe - ce);
|
|
3794
|
+
Me = we + (Ie - we) * Tt;
|
|
3789
3795
|
}
|
|
3790
3796
|
G.fillOpacity = Me;
|
|
3791
3797
|
}
|
|
@@ -3806,14 +3812,14 @@ const il = () => {
|
|
|
3806
3812
|
ze === "gradient" ? G.fillColor = Ie : G.fillColor = Me >= 0.5 ? Ie : we;
|
|
3807
3813
|
}
|
|
3808
3814
|
}
|
|
3809
|
-
return G.visible =
|
|
3815
|
+
return G.visible = nt, G.labelVisible === void 0 && (G.labelVisible = !1), console.log("📋 Final computed style:", {
|
|
3810
3816
|
shapeId: N.metadata?.id,
|
|
3811
3817
|
visible: G.visible,
|
|
3812
3818
|
labelVisible: G.labelVisible,
|
|
3813
3819
|
fillOpacity: G.fillOpacity,
|
|
3814
3820
|
strokeWidth: G.strokeWidth
|
|
3815
3821
|
}), G;
|
|
3816
|
-
}, []),
|
|
3822
|
+
}, []), ht = V((N, E, R = !1, Z = 0) => {
|
|
3817
3823
|
console.log("🎨 createShape called:", {
|
|
3818
3824
|
shapeId: E.metadata?.id,
|
|
3819
3825
|
shapeType: E.type,
|
|
@@ -3831,7 +3837,7 @@ const il = () => {
|
|
|
3831
3837
|
verticesLength: E.vertices?.length,
|
|
3832
3838
|
minVertices: ne
|
|
3833
3839
|
}), null;
|
|
3834
|
-
const F =
|
|
3840
|
+
const F = rt(E, Z);
|
|
3835
3841
|
let G;
|
|
3836
3842
|
switch (E.type) {
|
|
3837
3843
|
case "triangle":
|
|
@@ -3839,7 +3845,7 @@ const il = () => {
|
|
|
3839
3845
|
case "parallelogram":
|
|
3840
3846
|
case "trapezoid":
|
|
3841
3847
|
case "polygon":
|
|
3842
|
-
const
|
|
3848
|
+
const nt = F.labelVisible !== void 0 ? F.labelVisible : E.style?.labelVisible !== void 0 ? E.style.labelVisible : !1, Ge = E.metadata?.label || E.metadata?.id || "";
|
|
3843
3849
|
G = N.create("polygon", E.vertices, {
|
|
3844
3850
|
name: Ge,
|
|
3845
3851
|
fillColor: F.fillColor !== void 0 ? F.fillColor : R ? "#8ec5fc" : "#6a5acd",
|
|
@@ -3849,14 +3855,14 @@ const il = () => {
|
|
|
3849
3855
|
dash: F.dashStyle !== void 0 ? F.dashStyle : 0,
|
|
3850
3856
|
fixed: R,
|
|
3851
3857
|
highlight: !R,
|
|
3852
|
-
withLabel:
|
|
3858
|
+
withLabel: nt,
|
|
3853
3859
|
visible: F.visible !== void 0 ? F.visible : !0
|
|
3854
3860
|
});
|
|
3855
3861
|
break;
|
|
3856
3862
|
case "circle":
|
|
3857
3863
|
if (E.vertices.length >= 2) {
|
|
3858
|
-
const [
|
|
3859
|
-
G = N.create("circle", [
|
|
3864
|
+
const [ot, oe] = E.vertices, ce = F.labelVisible !== void 0 ? F.labelVisible : E.style?.labelVisible !== void 0 ? E.style.labelVisible : !1, pe = E.metadata?.label || E.metadata?.id || "";
|
|
3865
|
+
G = N.create("circle", [ot, oe], {
|
|
3860
3866
|
name: pe,
|
|
3861
3867
|
fillColor: F.fillColor !== void 0 ? F.fillColor : R ? "#8ec5fc" : "#6a5acd",
|
|
3862
3868
|
fillOpacity: F.fillOpacity !== void 0 ? F.fillOpacity : R ? 0.3 : 0.7,
|
|
@@ -3871,8 +3877,8 @@ const il = () => {
|
|
|
3871
3877
|
break;
|
|
3872
3878
|
case "point":
|
|
3873
3879
|
if (E.vertices.length >= 1) {
|
|
3874
|
-
const [
|
|
3875
|
-
G = N.create("point", [
|
|
3880
|
+
const [ot, oe] = E.vertices[0], ce = F.labelVisible !== void 0 ? F.labelVisible : E.style?.labelVisible !== void 0 ? E.style.labelVisible : !1, pe = E.metadata?.label || E.metadata?.id || "";
|
|
3881
|
+
G = N.create("point", [ot, oe], {
|
|
3876
3882
|
name: pe,
|
|
3877
3883
|
withLabel: ce,
|
|
3878
3884
|
fixed: R,
|
|
@@ -3898,7 +3904,7 @@ const il = () => {
|
|
|
3898
3904
|
hasLabel: !!E.metadata?.label,
|
|
3899
3905
|
withLabel: !!E.metadata?.label && F.labelVisible
|
|
3900
3906
|
}), G;
|
|
3901
|
-
}, [
|
|
3907
|
+
}, [rt]);
|
|
3902
3908
|
B(() => {
|
|
3903
3909
|
if (!(e > 0 && t > 0 && i?.animated?.length > 0)) {
|
|
3904
3910
|
console.log("🔍 GeometryTransform: 数据未就绪,跳过验证", {
|
|
@@ -3968,10 +3974,10 @@ const il = () => {
|
|
|
3968
3974
|
} catch {
|
|
3969
3975
|
}
|
|
3970
3976
|
}), ve.current = {}, i.static.forEach((N, E) => {
|
|
3971
|
-
const R = N.metadata?.id || `static-${E}`, Z =
|
|
3977
|
+
const R = N.metadata?.id || `static-${E}`, Z = ht(k, N, !0, 0);
|
|
3972
3978
|
Z && (ve.current[R] = Z);
|
|
3973
3979
|
}), i.animated.forEach((N, E) => {
|
|
3974
|
-
const R = N.metadata?.id || `animated-${E}`, Z =
|
|
3980
|
+
const R = N.metadata?.id || `animated-${E}`, Z = ht(k, N, !1, 0);
|
|
3975
3981
|
Z && (ve.current[R] = Z);
|
|
3976
3982
|
}), k.unsuspendUpdate(), p && p();
|
|
3977
3983
|
} catch (N) {
|
|
@@ -3999,12 +4005,12 @@ const il = () => {
|
|
|
3999
4005
|
}), i.animated.forEach((R, Z) => {
|
|
4000
4006
|
const ne = R.metadata?.id || `animated-${Z}`, F = R.transform ? {
|
|
4001
4007
|
...R,
|
|
4002
|
-
transform:
|
|
4008
|
+
transform: wt(R.transform)
|
|
4003
4009
|
} : R, G = U.executeShapeTransform(
|
|
4004
4010
|
F,
|
|
4005
4011
|
C,
|
|
4006
4012
|
re
|
|
4007
|
-
),
|
|
4013
|
+
), nt = {
|
|
4008
4014
|
...R,
|
|
4009
4015
|
vertices: G,
|
|
4010
4016
|
metadata: {
|
|
@@ -4014,7 +4020,7 @@ const il = () => {
|
|
|
4014
4020
|
transformSource: R.transform ? "shape" : "global"
|
|
4015
4021
|
// Use the computed transformSource with fallback
|
|
4016
4022
|
}
|
|
4017
|
-
}, Ge =
|
|
4023
|
+
}, Ge = ht(k, nt, !1, C);
|
|
4018
4024
|
Ge && (ve.current[ne] = Ge);
|
|
4019
4025
|
});
|
|
4020
4026
|
const N = c.progressIndicator?.stages || 1, E = Math.min(Math.floor(C * N), N - 1);
|
|
@@ -4030,8 +4036,8 @@ const il = () => {
|
|
|
4030
4036
|
}
|
|
4031
4037
|
}
|
|
4032
4038
|
}
|
|
4033
|
-
}, [k, C, i, a, c,
|
|
4034
|
-
const
|
|
4039
|
+
}, [k, C, i, a, c, ht, re, U]);
|
|
4040
|
+
const Et = V((N) => {
|
|
4035
4041
|
const E = Array.isArray(N) ? N[0] : N;
|
|
4036
4042
|
w(E), q(E, (R) => {
|
|
4037
4043
|
b?.(R);
|
|
@@ -4041,12 +4047,12 @@ const il = () => {
|
|
|
4041
4047
|
if (!m) return;
|
|
4042
4048
|
const N = (E) => {
|
|
4043
4049
|
const R = _e(E, C);
|
|
4044
|
-
R !== null && R !== C &&
|
|
4050
|
+
R !== null && R !== C && Et(R);
|
|
4045
4051
|
};
|
|
4046
4052
|
return window.addEventListener("keydown", N), () => {
|
|
4047
4053
|
window.removeEventListener("keydown", N);
|
|
4048
4054
|
};
|
|
4049
|
-
}, [m, C,
|
|
4055
|
+
}, [m, C, Et, _e]), V(() => {
|
|
4050
4056
|
w(0), $(0), ue();
|
|
4051
4057
|
}, [ue]);
|
|
4052
4058
|
const Ir = V(() => {
|
|
@@ -4119,7 +4125,7 @@ const il = () => {
|
|
|
4119
4125
|
id: "transform-slider",
|
|
4120
4126
|
"data-testid": "slider",
|
|
4121
4127
|
value: C,
|
|
4122
|
-
onChange:
|
|
4128
|
+
onChange: Et,
|
|
4123
4129
|
minValue: 0,
|
|
4124
4130
|
maxValue: 1,
|
|
4125
4131
|
step: 0.01,
|
|
@@ -5320,24 +5326,24 @@ function Bo(r, e = {}) {
|
|
|
5320
5326
|
s.push(A.position);
|
|
5321
5327
|
break;
|
|
5322
5328
|
case "line":
|
|
5323
|
-
const P =
|
|
5329
|
+
const P = gt(A.start, r), $ = gt(A.end, r);
|
|
5324
5330
|
P && s.push(P), $ && s.push($);
|
|
5325
5331
|
break;
|
|
5326
5332
|
case "circle":
|
|
5327
|
-
const k =
|
|
5333
|
+
const k = gt(A.center, r);
|
|
5328
5334
|
if (k && (s.push(k), A.radius !== void 0 && s.push(
|
|
5329
5335
|
{ x: k.x + A.radius, y: k.y },
|
|
5330
5336
|
{ x: k.x - A.radius, y: k.y },
|
|
5331
5337
|
{ x: k.x, y: k.y + A.radius },
|
|
5332
5338
|
{ x: k.x, y: k.y - A.radius }
|
|
5333
5339
|
)), A.through) {
|
|
5334
|
-
const M =
|
|
5340
|
+
const M = gt(A.through, r);
|
|
5335
5341
|
M && s.push(M);
|
|
5336
5342
|
}
|
|
5337
5343
|
break;
|
|
5338
5344
|
case "polygon":
|
|
5339
5345
|
A.vertices.forEach((M) => {
|
|
5340
|
-
const U =
|
|
5346
|
+
const U = gt(M, r);
|
|
5341
5347
|
U && s.push(U);
|
|
5342
5348
|
});
|
|
5343
5349
|
break;
|
|
@@ -5386,7 +5392,7 @@ function Bo(r, e = {}) {
|
|
|
5386
5392
|
height: b
|
|
5387
5393
|
};
|
|
5388
5394
|
}
|
|
5389
|
-
function
|
|
5395
|
+
function gt(r, e = []) {
|
|
5390
5396
|
if (typeof r == "object" && r !== null) {
|
|
5391
5397
|
if ("x" in r && "y" in r)
|
|
5392
5398
|
return { x: r.x, y: r.y };
|
|
@@ -5426,7 +5432,7 @@ function Tl(r, e = "Debug") {
|
|
|
5426
5432
|
break;
|
|
5427
5433
|
case "polygon":
|
|
5428
5434
|
o.vertices.forEach((a, c) => {
|
|
5429
|
-
const l =
|
|
5435
|
+
const l = gt(a, r);
|
|
5430
5436
|
l && t.push({
|
|
5431
5437
|
x: l.x,
|
|
5432
5438
|
y: l.y,
|
|
@@ -7398,9 +7404,11 @@ const qo = lo(null), Zl = () => {
|
|
|
7398
7404
|
return d ? /* @__PURE__ */ f("div", { className: `grade-unit-browser-page loading ${n || ""}`, "data-testid": "grade-unit-browser-page", children: /* @__PURE__ */ f("div", { className: "loading-spinner", "data-testid": "loading-spinner", children: "加载中..." }) }) : u ? /* @__PURE__ */ v("div", { className: `grade-unit-browser-page error ${n || ""}`, "data-testid": "grade-unit-browser-page", children: [
|
|
7399
7405
|
/* @__PURE__ */ f("div", { className: "error-message", "data-testid": "error-message", children: u }),
|
|
7400
7406
|
/* @__PURE__ */ f(
|
|
7401
|
-
|
|
7407
|
+
tt,
|
|
7402
7408
|
{
|
|
7403
7409
|
onClick: () => p(r, e),
|
|
7410
|
+
intent: "retry",
|
|
7411
|
+
useNewClassName: !0,
|
|
7404
7412
|
className: "retry-button",
|
|
7405
7413
|
children: "重试"
|
|
7406
7414
|
}
|
|
@@ -7539,7 +7547,7 @@ const qo = lo(null), Zl = () => {
|
|
|
7539
7547
|
validationError: null
|
|
7540
7548
|
});
|
|
7541
7549
|
}
|
|
7542
|
-
})),
|
|
7550
|
+
})), mt = rc(), Yo = () => mt((r) => r.currentScene), Ho = () => mt((r) => r.userAnswer), Dm = () => mt((r) => r.isCorrect), Ko = () => mt((r) => r.showAnswerForm), nc = () => mt((r) => r.validationError), Lm = () => mt((r) => r.problemData), Xo = () => mt(
|
|
7543
7551
|
on((r) => ({
|
|
7544
7552
|
updateUserAnswer: r.updateUserAnswer,
|
|
7545
7553
|
submitAnswer: r.submitAnswer,
|
|
@@ -7652,10 +7660,12 @@ const qo = lo(null), Zl = () => {
|
|
|
7652
7660
|
),
|
|
7653
7661
|
/* @__PURE__ */ f("span", { className: "answer-unit", children: r.basicInfo.answerUnit || r.basicInfo.areaUnit }),
|
|
7654
7662
|
/* @__PURE__ */ f(
|
|
7655
|
-
|
|
7663
|
+
tt,
|
|
7656
7664
|
{
|
|
7657
7665
|
type: "submit",
|
|
7658
7666
|
size: "lg",
|
|
7667
|
+
intent: "submit",
|
|
7668
|
+
useNewClassName: !0,
|
|
7659
7669
|
className: "submit-button",
|
|
7660
7670
|
children: "提交答案"
|
|
7661
7671
|
}
|
|
@@ -7928,39 +7938,53 @@ const Zo = ({
|
|
|
7928
7938
|
problemData: r,
|
|
7929
7939
|
enableIXLStyle: e = !0
|
|
7930
7940
|
}) => {
|
|
7931
|
-
const [t, n] = X(!1), o = r?.scenes?.solve?.items || r?.scenes?.solve?.content, s = Array.isArray(o) && o.length > 0, i = W(
|
|
7941
|
+
const [t, n] = X(!1), o = r?.scenes?.solve?.items || r?.scenes?.solve?.content, s = Array.isArray(o) && o.length > 0, i = W(() => o && o.map((u) => u.type === "geometryTransform" && u.metadata?.config && !u.config ? {
|
|
7942
|
+
...u,
|
|
7943
|
+
config: u.metadata.config
|
|
7944
|
+
} : u), [o]), a = W(
|
|
7932
7945
|
() => hc(r.explanation),
|
|
7933
7946
|
[r.explanation]
|
|
7934
|
-
),
|
|
7935
|
-
...
|
|
7947
|
+
), c = a.steps.length > 0, l = W(() => c ? a.steps.map((u) => ({
|
|
7948
|
+
...u,
|
|
7936
7949
|
content: {
|
|
7937
|
-
title:
|
|
7938
|
-
description:
|
|
7939
|
-
chartConfig:
|
|
7940
|
-
...
|
|
7941
|
-
boundingBox:
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
|
|
7950
|
+
title: u.title,
|
|
7951
|
+
description: u.description,
|
|
7952
|
+
chartConfig: u.chartConfig ? {
|
|
7953
|
+
...u.chartConfig,
|
|
7954
|
+
boundingBox: u.chartConfig.type === "graph" && Array.isArray(u.chartConfig.boundingBox) && u.chartConfig.boundingBox.length === 4 ? [
|
|
7955
|
+
u.chartConfig.boundingBox[0],
|
|
7956
|
+
u.chartConfig.boundingBox[1],
|
|
7957
|
+
u.chartConfig.boundingBox[2],
|
|
7958
|
+
u.chartConfig.boundingBox[3]
|
|
7946
7959
|
] : [-10, 10, 10, -10]
|
|
7947
7960
|
} : void 0
|
|
7948
7961
|
}
|
|
7949
|
-
})) : [], [
|
|
7962
|
+
})) : [], [c, a.steps]), d = /* @__PURE__ */ v("div", { className: "solve-module-content", children: [
|
|
7950
7963
|
s ? /* @__PURE__ */ v(Dt, { children: [
|
|
7951
7964
|
console.log("🔍 SolveModule: solveContent =", o),
|
|
7952
|
-
o?.forEach?.((
|
|
7953
|
-
|
|
7954
|
-
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
|
|
7958
|
-
|
|
7959
|
-
|
|
7960
|
-
|
|
7961
|
-
|
|
7962
|
-
|
|
7963
|
-
|
|
7965
|
+
o?.forEach?.((u, y) => {
|
|
7966
|
+
if (u.type === "geometryTransform") {
|
|
7967
|
+
const m = i?.[y];
|
|
7968
|
+
console.log(`🔍 SolveModule: geometryTransform block [${y}] =`, {
|
|
7969
|
+
type: u.type,
|
|
7970
|
+
hasMetadata: !!u.metadata,
|
|
7971
|
+
metadata: u.metadata,
|
|
7972
|
+
hasMetadataConfig: !!u.metadata?.config,
|
|
7973
|
+
metadataConfig: u.metadata?.config,
|
|
7974
|
+
hasConfig: !!u.config,
|
|
7975
|
+
config: u.config,
|
|
7976
|
+
hasShapes: !!u.shapes,
|
|
7977
|
+
shapes: u.shapes,
|
|
7978
|
+
hasTransform: !!u.transform,
|
|
7979
|
+
transform: u.transform,
|
|
7980
|
+
// 修复后的块信息
|
|
7981
|
+
fixedBlockHasConfig: !!m?.config,
|
|
7982
|
+
fixedBlockConfig: m?.config,
|
|
7983
|
+
fixedBlockHasMetadataConfig: !!m?.metadata?.config,
|
|
7984
|
+
fixedBlockMetadataConfig: m?.metadata?.config,
|
|
7985
|
+
isConfigFixed: !u.config && !!m?.config
|
|
7986
|
+
});
|
|
7987
|
+
}
|
|
7964
7988
|
}),
|
|
7965
7989
|
/* @__PURE__ */ f(
|
|
7966
7990
|
Ce,
|
|
@@ -7969,7 +7993,7 @@ const Zo = ({
|
|
|
7969
7993
|
id: "solve-steps",
|
|
7970
7994
|
grade: r.grade,
|
|
7971
7995
|
unit: r.unit,
|
|
7972
|
-
content:
|
|
7996
|
+
content: i
|
|
7973
7997
|
},
|
|
7974
7998
|
scene: "solve",
|
|
7975
7999
|
layout: { type: "flow", direction: "vertical", gap: "12px" },
|
|
@@ -7978,24 +8002,26 @@ const Zo = ({
|
|
|
7978
8002
|
)
|
|
7979
8003
|
] }) : /* @__PURE__ */ f("div", { className: "solve-module-empty", children: "空白(暂无简化解题步骤)" }),
|
|
7980
8004
|
/* @__PURE__ */ f("div", { className: "solve-module-button-container", children: /* @__PURE__ */ f(
|
|
7981
|
-
|
|
8005
|
+
tt,
|
|
7982
8006
|
{
|
|
7983
|
-
|
|
7984
|
-
|
|
8007
|
+
intent: "solve",
|
|
8008
|
+
variant: "light",
|
|
8009
|
+
useNewClassName: !0,
|
|
8010
|
+
onClick: () => n((u) => !u),
|
|
7985
8011
|
className: "solve-module-button",
|
|
7986
8012
|
children: t ? "收起详细解题步骤" : "查看详细解题步骤"
|
|
7987
8013
|
}
|
|
7988
8014
|
) }),
|
|
7989
8015
|
t && /* @__PURE__ */ v("div", { className: "solve-module-detailed-container", children: [
|
|
7990
8016
|
/* @__PURE__ */ f("h5", { className: "solve-module-detailed-title", children: "详细解题步骤" }),
|
|
7991
|
-
|
|
8017
|
+
c ? /* @__PURE__ */ f("div", { className: "solve-module-detailed-list", children: l.map((u, y) => /* @__PURE__ */ f(
|
|
7992
8018
|
uc,
|
|
7993
8019
|
{
|
|
7994
|
-
step:
|
|
8020
|
+
step: u,
|
|
7995
8021
|
problemData: r,
|
|
7996
|
-
stepNumber:
|
|
8022
|
+
stepNumber: y + 1
|
|
7997
8023
|
},
|
|
7998
|
-
|
|
8024
|
+
u.id
|
|
7999
8025
|
)) }) : /* @__PURE__ */ f("div", { className: "solve-module-empty", children: "暂无详细解题步骤" })
|
|
8000
8026
|
] })
|
|
8001
8027
|
] });
|
|
@@ -8005,11 +8031,11 @@ const Zo = ({
|
|
|
8005
8031
|
wrapperMode: "generic",
|
|
8006
8032
|
ixlConfig: { type: "solve", label: "解答", showTag: !0 },
|
|
8007
8033
|
enableIXLStyle: !0,
|
|
8008
|
-
children:
|
|
8034
|
+
children: d
|
|
8009
8035
|
}
|
|
8010
8036
|
) : /* @__PURE__ */ v("div", { className: "solve-module-container", children: [
|
|
8011
8037
|
/* @__PURE__ */ f("h4", { className: "solve-module-title", children: "解题" }),
|
|
8012
|
-
|
|
8038
|
+
d
|
|
8013
8039
|
] });
|
|
8014
8040
|
}, Nr = ({
|
|
8015
8041
|
problemData: r,
|
|
@@ -8026,10 +8052,12 @@ const Zo = ({
|
|
|
8026
8052
|
] })
|
|
8027
8053
|
] }),
|
|
8028
8054
|
/* @__PURE__ */ f("div", { className: "explanation-button-container", children: /* @__PURE__ */ f(
|
|
8029
|
-
|
|
8055
|
+
tt,
|
|
8030
8056
|
{
|
|
8031
8057
|
onClick: t,
|
|
8032
8058
|
size: "lg",
|
|
8059
|
+
intent: "next",
|
|
8060
|
+
useNewClassName: !0,
|
|
8033
8061
|
className: "explanation-next-button",
|
|
8034
8062
|
children: "明白了"
|
|
8035
8063
|
}
|
|
@@ -8058,10 +8086,12 @@ const Zo = ({
|
|
|
8058
8086
|
)
|
|
8059
8087
|
] }),
|
|
8060
8088
|
/* @__PURE__ */ f("div", { className: "explanation-bottom-area", children: /* @__PURE__ */ f(
|
|
8061
|
-
|
|
8089
|
+
tt,
|
|
8062
8090
|
{
|
|
8063
8091
|
onClick: t,
|
|
8064
8092
|
size: "md",
|
|
8093
|
+
intent: "next",
|
|
8094
|
+
useNewClassName: !0,
|
|
8065
8095
|
children: "明白了"
|
|
8066
8096
|
}
|
|
8067
8097
|
) })
|
|
@@ -8095,10 +8125,12 @@ const Zo = ({
|
|
|
8095
8125
|
}
|
|
8096
8126
|
) }),
|
|
8097
8127
|
/* @__PURE__ */ f(
|
|
8098
|
-
|
|
8128
|
+
tt,
|
|
8099
8129
|
{
|
|
8100
8130
|
onClick: e,
|
|
8101
8131
|
size: "lg",
|
|
8132
|
+
intent: "next",
|
|
8133
|
+
useNewClassName: !0,
|
|
8102
8134
|
className: "next-button",
|
|
8103
8135
|
children: "下一题"
|
|
8104
8136
|
}
|
|
@@ -8207,7 +8239,7 @@ const dr = {
|
|
|
8207
8239
|
[z.SLIDER_REF_NOT_FOUND]: "滑块引用未找到",
|
|
8208
8240
|
[z.TRANSFORMATION_FAILED]: "数据转换失败",
|
|
8209
8241
|
[z.OUTPUT_VALIDATION_FAILED]: "输出验证失败"
|
|
8210
|
-
},
|
|
8242
|
+
}, it = {
|
|
8211
8243
|
MAX_TRANSFORMATION_TIME: 5,
|
|
8212
8244
|
// 最大转换时间 5ms
|
|
8213
8245
|
MAX_MEMORY_INCREASE: 50 * 1024,
|
|
@@ -8550,7 +8582,7 @@ const dr = {
|
|
|
8550
8582
|
description: "缩放变换"
|
|
8551
8583
|
}
|
|
8552
8584
|
}
|
|
8553
|
-
},
|
|
8585
|
+
}, yt = {
|
|
8554
8586
|
slider_definitions: {
|
|
8555
8587
|
slider_horizontal: {
|
|
8556
8588
|
id: "slider_horizontal",
|
|
@@ -8617,23 +8649,23 @@ const dr = {
|
|
|
8617
8649
|
description: "扩展画板配置(带网格和坐标轴)"
|
|
8618
8650
|
}
|
|
8619
8651
|
}
|
|
8620
|
-
},
|
|
8652
|
+
}, ct = {
|
|
8621
8653
|
designTokens: es.design_tokens,
|
|
8622
8654
|
stylePresets: ts.style_presets,
|
|
8623
8655
|
geometryPresets: rs.geometry_presets,
|
|
8624
8656
|
layoutPresets: ns.layout_presets,
|
|
8625
8657
|
transformDefinitions: os.transform_definitions,
|
|
8626
8658
|
// 同时提供两个字段名,确保兼容性
|
|
8627
|
-
animationDefinitions:
|
|
8628
|
-
animationConfigs:
|
|
8659
|
+
animationDefinitions: yt.slider_definitions,
|
|
8660
|
+
animationConfigs: yt.slider_definitions,
|
|
8629
8661
|
boardDefinitions: ss.board_definitions
|
|
8630
8662
|
};
|
|
8631
8663
|
function is() {
|
|
8632
8664
|
console.error("🔍 getDefaultReferenceContext called:", {
|
|
8633
|
-
hasEmbeddedAnimationDefinitions: !!
|
|
8634
|
-
sliderDefinitionsKeys:
|
|
8665
|
+
hasEmbeddedAnimationDefinitions: !!yt,
|
|
8666
|
+
sliderDefinitionsKeys: yt.slider_definitions ? Object.keys(yt.slider_definitions) : []
|
|
8635
8667
|
});
|
|
8636
|
-
const r =
|
|
8668
|
+
const r = yt.slider_definitions;
|
|
8637
8669
|
return {
|
|
8638
8670
|
designTokens: es.design_tokens,
|
|
8639
8671
|
stylePresets: ts.style_presets,
|
|
@@ -8946,7 +8978,7 @@ class Ee {
|
|
|
8946
8978
|
* 检查是否能够解析该引用
|
|
8947
8979
|
*/
|
|
8948
8980
|
static canResolve(e) {
|
|
8949
|
-
return typeof e != "string" || e.length === 0 ? !1 : se.TRANSFORM_REF.test(e) ? !0 :
|
|
8981
|
+
return typeof e != "string" || e.length === 0 ? !1 : se.TRANSFORM_REF.test(e) ? !0 : /_(rotation|translation|scale|transform|reflection|shear|mirror)$/i.test(e);
|
|
8950
8982
|
}
|
|
8951
8983
|
/**
|
|
8952
8984
|
* 解析变换引用
|
|
@@ -8958,13 +8990,9 @@ class Ee {
|
|
|
8958
8990
|
const o = e.match(se.TRANSFORM_REF);
|
|
8959
8991
|
if (o ? n = o[1] : n = e, t.transformDefinitions && t.transformDefinitions[n])
|
|
8960
8992
|
return { ...t.transformDefinitions[n] };
|
|
8961
|
-
const s =
|
|
8962
|
-
|
|
8963
|
-
|
|
8964
|
-
translation: { type: "translation", dx: 0, dy: 0 }
|
|
8965
|
-
};
|
|
8966
|
-
if (s[n])
|
|
8967
|
-
return { ...s[n] };
|
|
8993
|
+
const s = this.createDefaultTransform(n);
|
|
8994
|
+
if (s)
|
|
8995
|
+
return console.warn(`⚠️ 使用智能默认变换: ${n}`, s), s;
|
|
8968
8996
|
throw new Error(`变换定义未找到: ${n}`);
|
|
8969
8997
|
}
|
|
8970
8998
|
/**
|
|
@@ -8975,7 +9003,7 @@ class Ee {
|
|
|
8975
9003
|
return !1;
|
|
8976
9004
|
let n;
|
|
8977
9005
|
const o = e.match(se.TRANSFORM_REF);
|
|
8978
|
-
return o ? n = o[1] : n = e, t.transformDefinitions && t.transformDefinitions[n] ? !0 :
|
|
9006
|
+
return o ? n = o[1] : n = e, t.transformDefinitions && t.transformDefinitions[n] ? !0 : this.createDefaultTransform(n) !== null;
|
|
8979
9007
|
}
|
|
8980
9008
|
/**
|
|
8981
9009
|
* 应用变换到几何对象
|
|
@@ -9035,6 +9063,52 @@ class Ee {
|
|
|
9035
9063
|
];
|
|
9036
9064
|
});
|
|
9037
9065
|
}
|
|
9066
|
+
/**
|
|
9067
|
+
* 根据变换名称创建智能默认变换
|
|
9068
|
+
*/
|
|
9069
|
+
static createDefaultTransform(e) {
|
|
9070
|
+
const t = e.toLowerCase();
|
|
9071
|
+
if (t.includes("rotation") || t.includes("rotate")) {
|
|
9072
|
+
let n = 0, o = Math.PI, s = "clockwise";
|
|
9073
|
+
return t.includes("left") ? (s = "clockwise", o = Math.PI) : t.includes("right") ? (s = "counterclockwise", o = Math.PI) : t.includes("half") || t.includes("180") ? o = Math.PI : t.includes("full") || t.includes("360") ? o = 2 * Math.PI : (t.includes("quarter") || t.includes("90")) && (o = Math.PI / 2), {
|
|
9074
|
+
type: "rotation",
|
|
9075
|
+
config: {
|
|
9076
|
+
center: [0, 0],
|
|
9077
|
+
startAngle: n,
|
|
9078
|
+
endAngle: o,
|
|
9079
|
+
direction: s
|
|
9080
|
+
}
|
|
9081
|
+
};
|
|
9082
|
+
} else if (t.includes("translation") || t.includes("translate") || t.includes("move")) {
|
|
9083
|
+
let n = [0, 0], o = 0;
|
|
9084
|
+
return t.includes("left") || t.includes("west") ? (n = [-1, 0], o = 10) : t.includes("right") || t.includes("east") ? (n = [1, 0], o = 10) : t.includes("up") || t.includes("north") ? (n = [0, 1], o = 10) : t.includes("down") || t.includes("south") ? (n = [0, -1], o = 10) : t.includes("horizontal") ? (n = "horizontal", o = 10) : t.includes("vertical") && (n = "vertical", o = 10), {
|
|
9085
|
+
type: "translation",
|
|
9086
|
+
config: {
|
|
9087
|
+
direction: n,
|
|
9088
|
+
distance: o
|
|
9089
|
+
}
|
|
9090
|
+
};
|
|
9091
|
+
} else if (t.includes("scale") || t.includes("zoom")) {
|
|
9092
|
+
let n = 1, o = 1;
|
|
9093
|
+
return t.includes("enlarge") || t.includes("bigger") || t.includes("up") ? o = 2 : (t.includes("shrink") || t.includes("smaller") || t.includes("down")) && (o = 0.5), {
|
|
9094
|
+
type: "scale",
|
|
9095
|
+
config: {
|
|
9096
|
+
center: [0, 0],
|
|
9097
|
+
startScale: n,
|
|
9098
|
+
endScale: o,
|
|
9099
|
+
uniform: !0
|
|
9100
|
+
}
|
|
9101
|
+
};
|
|
9102
|
+
} else if (t.includes("transform") || t.includes("main") || t.includes("default") || t.includes("primary"))
|
|
9103
|
+
return {
|
|
9104
|
+
type: "translation",
|
|
9105
|
+
config: {
|
|
9106
|
+
direction: "horizontal",
|
|
9107
|
+
distance: 0
|
|
9108
|
+
}
|
|
9109
|
+
};
|
|
9110
|
+
return null;
|
|
9111
|
+
}
|
|
9038
9112
|
/**
|
|
9039
9113
|
* 批量解析变换引用
|
|
9040
9114
|
*/
|
|
@@ -9317,7 +9391,7 @@ function wc() {
|
|
|
9317
9391
|
validate: Ve.validate.bind(Ve)
|
|
9318
9392
|
};
|
|
9319
9393
|
}
|
|
9320
|
-
class
|
|
9394
|
+
class at {
|
|
9321
9395
|
/**
|
|
9322
9396
|
* 检查是否能够解析该引用
|
|
9323
9397
|
* 只接受明确的 animationRef:xxx 格式,拒绝简单的标识符
|
|
@@ -9473,9 +9547,9 @@ ${i.errors?.join(`
|
|
|
9473
9547
|
function Ac() {
|
|
9474
9548
|
return {
|
|
9475
9549
|
type: te.ANIMATION_REF,
|
|
9476
|
-
canResolve:
|
|
9477
|
-
resolve:
|
|
9478
|
-
validate:
|
|
9550
|
+
canResolve: at.canResolve.bind(at),
|
|
9551
|
+
resolve: at.resolve.bind(at),
|
|
9552
|
+
validate: at.validate.bind(at)
|
|
9479
9553
|
};
|
|
9480
9554
|
}
|
|
9481
9555
|
class Qe {
|
|
@@ -9510,13 +9584,13 @@ class Qe {
|
|
|
9510
9584
|
);
|
|
9511
9585
|
const n = e.match(se.SLIDER_REF), o = n ? n[1] : e;
|
|
9512
9586
|
let s = t.animationDefinitions?.[o];
|
|
9513
|
-
return !s && t.animationConfigs && (s = t.animationConfigs[o]), !s &&
|
|
9587
|
+
return !s && t.animationConfigs && (s = t.animationConfigs[o]), !s && ct?.animationDefinitions && (s = ct.animationDefinitions[o]), !s && ct?.animationConfigs && (s = ct.animationConfigs[o]), console.error("🔍 SliderRefResolver.resolve lookup:", {
|
|
9514
9588
|
sliderConfigId: o,
|
|
9515
9589
|
hasRawConfig: !!s,
|
|
9516
9590
|
rawConfig: s,
|
|
9517
9591
|
animationDefinitions: t.animationDefinitions,
|
|
9518
9592
|
animationConfigs: t.animationConfigs,
|
|
9519
|
-
hasGlobalContext: !!
|
|
9593
|
+
hasGlobalContext: !!ct
|
|
9520
9594
|
}), s ? this.validateAndTransformConfig(o, s) : (console.warn(`⚠️ 滑块配置未找到: ${o},使用默认配置`), {
|
|
9521
9595
|
...Rc,
|
|
9522
9596
|
id: o
|
|
@@ -9654,7 +9728,7 @@ function xc() {
|
|
|
9654
9728
|
validate: Qe.validate.bind(Qe)
|
|
9655
9729
|
};
|
|
9656
9730
|
}
|
|
9657
|
-
class
|
|
9731
|
+
class lt {
|
|
9658
9732
|
/**
|
|
9659
9733
|
* 检查是否能够解析该引用
|
|
9660
9734
|
*/
|
|
@@ -9743,9 +9817,9 @@ class at {
|
|
|
9743
9817
|
function Sc() {
|
|
9744
9818
|
return {
|
|
9745
9819
|
type: te.GEOMETRY_TRANSFORM_REF,
|
|
9746
|
-
canResolve:
|
|
9747
|
-
resolve:
|
|
9748
|
-
validate:
|
|
9820
|
+
canResolve: lt.canResolve.bind(lt),
|
|
9821
|
+
resolve: lt.resolve.bind(lt),
|
|
9822
|
+
validate: lt.validate.bind(lt)
|
|
9749
9823
|
};
|
|
9750
9824
|
}
|
|
9751
9825
|
const jr = {
|
|
@@ -9808,13 +9882,13 @@ class Cc {
|
|
|
9808
9882
|
}
|
|
9809
9883
|
if (typeof a == "string") {
|
|
9810
9884
|
this.extractDesignTokens(a).forEach((l) => {
|
|
9811
|
-
const d =
|
|
9885
|
+
const d = l;
|
|
9812
9886
|
n.has(d) || (n.add(d), t.push({
|
|
9813
9887
|
ref: l,
|
|
9814
|
-
type: te.
|
|
9888
|
+
type: te.DESIGN_TOKEN,
|
|
9815
9889
|
path: "$ref",
|
|
9816
9890
|
value: l,
|
|
9817
|
-
fieldName: "
|
|
9891
|
+
fieldName: "",
|
|
9818
9892
|
combined: d
|
|
9819
9893
|
}));
|
|
9820
9894
|
});
|
|
@@ -9867,7 +9941,7 @@ class Cc {
|
|
|
9867
9941
|
};
|
|
9868
9942
|
}
|
|
9869
9943
|
}
|
|
9870
|
-
class
|
|
9944
|
+
class pt {
|
|
9871
9945
|
resolvers = [];
|
|
9872
9946
|
constructor() {
|
|
9873
9947
|
this.registerDefaultResolvers();
|
|
@@ -10014,7 +10088,7 @@ class gt {
|
|
|
10014
10088
|
}
|
|
10015
10089
|
}
|
|
10016
10090
|
function as() {
|
|
10017
|
-
return new
|
|
10091
|
+
return new pt();
|
|
10018
10092
|
}
|
|
10019
10093
|
class tr {
|
|
10020
10094
|
/**
|
|
@@ -10070,7 +10144,7 @@ class tr {
|
|
|
10070
10144
|
if (i.animationRef) {
|
|
10071
10145
|
console.warn(`🎬 GraphTransformer处理animationRef: ${i.animationRef}`);
|
|
10072
10146
|
try {
|
|
10073
|
-
const a = i.animationRef.startsWith("animationRef:") ? i.animationRef : `animationRef:${i.animationRef}`, c =
|
|
10147
|
+
const a = i.animationRef.startsWith("animationRef:") ? i.animationRef : `animationRef:${i.animationRef}`, c = at.resolve(a, t);
|
|
10074
10148
|
console.warn(" 动画配置解析结果:", {
|
|
10075
10149
|
animationId: c.id,
|
|
10076
10150
|
transformCount: c.transforms.length,
|
|
@@ -10537,7 +10611,7 @@ class rr {
|
|
|
10537
10611
|
try {
|
|
10538
10612
|
if (o) {
|
|
10539
10613
|
console.error("🔍 GeometryTransformTransformer: 解析 geometryTransformRef:", e.geometryTransformRef);
|
|
10540
|
-
const d =
|
|
10614
|
+
const d = lt.resolve(
|
|
10541
10615
|
e.geometryTransformRef,
|
|
10542
10616
|
t,
|
|
10543
10617
|
e.override
|
|
@@ -10905,11 +10979,11 @@ class rr {
|
|
|
10905
10979
|
});
|
|
10906
10980
|
try {
|
|
10907
10981
|
const a = {
|
|
10908
|
-
...
|
|
10982
|
+
...ct,
|
|
10909
10983
|
...t,
|
|
10910
10984
|
// 传入的上下文优先级更高
|
|
10911
10985
|
// 确保 animationDefinitions 存在
|
|
10912
|
-
animationDefinitions: t.animationDefinitions ||
|
|
10986
|
+
animationDefinitions: t.animationDefinitions || ct.animationDefinitions
|
|
10913
10987
|
}, c = Qe.resolve(
|
|
10914
10988
|
s.sliderRef,
|
|
10915
10989
|
a
|
|
@@ -11081,11 +11155,7 @@ class rr {
|
|
|
11081
11155
|
}
|
|
11082
11156
|
delete s.styleRef;
|
|
11083
11157
|
}
|
|
11084
|
-
if (s.metadata || (s.metadata = {}), !s.metadata.id && s.id && (s.metadata.id = s.id), s.withLabel !== void 0 && (s.metadata.showLabel = s.withLabel, delete s.withLabel), s.label && (typeof s.label == "object" ? s.metadata.label = s.label.text || s.metadata.id || "" : typeof s.label == "string" && (s.metadata.label = s.label), delete s.label), s.metadata.showLabel && !s.metadata.label && s.metadata.id && (s.metadata.label = s.metadata.id), s.metadata.id) {
|
|
11085
|
-
const i = s.metadata.id.toLowerCase();
|
|
11086
|
-
i.includes("left") ? s.metadata.rotationGroup = "left" : i.includes("right") ? s.metadata.rotationGroup = "right" : s.metadata.rotationGroup = s.metadata.id;
|
|
11087
|
-
}
|
|
11088
|
-
if (s.type === "point" && s.position) {
|
|
11158
|
+
if (s.metadata || (s.metadata = {}), !s.metadata.id && s.id && (s.metadata.id = s.id), s.withLabel !== void 0 && (s.metadata.showLabel = s.withLabel, delete s.withLabel), s.label && (typeof s.label == "object" ? s.metadata.label = s.label.text || s.metadata.id || "" : typeof s.label == "string" && (s.metadata.label = s.label), delete s.label), s.metadata.showLabel && !s.metadata.label && s.metadata.id && (s.metadata.label = s.metadata.id), s.metadata.id && (s.metadata.rotationGroup = s.metadata.id), s.type === "point" && s.position) {
|
|
11089
11159
|
console.error("🔍 transformShape: 转换point为circle:", {
|
|
11090
11160
|
shapeId: s.metadata?.id,
|
|
11091
11161
|
position: s.position,
|
|
@@ -11867,7 +11937,7 @@ class Yn {
|
|
|
11867
11937
|
return this.validate(e, { strictMode: !1, checkSceneContent: !1 }).isValid;
|
|
11868
11938
|
}
|
|
11869
11939
|
}
|
|
11870
|
-
class
|
|
11940
|
+
class At {
|
|
11871
11941
|
/**
|
|
11872
11942
|
* 验证输入数据
|
|
11873
11943
|
*/
|
|
@@ -11947,7 +12017,7 @@ class Qr {
|
|
|
11947
12017
|
[te.GEOMETRY_REF]: [],
|
|
11948
12018
|
[te.TRANSFORM_REF]: [],
|
|
11949
12019
|
[te.LAYOUT_REF]: []
|
|
11950
|
-
}, o = new
|
|
12020
|
+
}, o = new pt();
|
|
11951
12021
|
for (const s of e) {
|
|
11952
12022
|
const i = o.getResolverForRef(s);
|
|
11953
12023
|
i && n[i.type].push(s);
|
|
@@ -11958,7 +12028,7 @@ class Qr {
|
|
|
11958
12028
|
* 批量解析引用
|
|
11959
12029
|
*/
|
|
11960
12030
|
static batchResolveReferences(e, t, n = {}) {
|
|
11961
|
-
const { strictMode: o = !1, onMissing: s } = n, i = new
|
|
12031
|
+
const { strictMode: o = !1, onMissing: s } = n, i = new pt(), a = {};
|
|
11962
12032
|
for (const c of e) {
|
|
11963
12033
|
const l = i.getResolverForRef(c);
|
|
11964
12034
|
if (l)
|
|
@@ -11976,7 +12046,7 @@ class Qr {
|
|
|
11976
12046
|
* 替换对象中的引用
|
|
11977
12047
|
*/
|
|
11978
12048
|
static replaceReferences(e, t, n = {}) {
|
|
11979
|
-
const { strictMode: o = !1, onMissing: s, maxDepth: i = 10 } = n, a = new
|
|
12049
|
+
const { strictMode: o = !1, onMissing: s, maxDepth: i = 10 } = n, a = new pt(), c = /* @__PURE__ */ new Set([
|
|
11980
12050
|
"geometryRef",
|
|
11981
12051
|
"styleRef",
|
|
11982
12052
|
"transformRef",
|
|
@@ -12081,7 +12151,7 @@ class Qr {
|
|
|
12081
12151
|
* 计算引用解析统计
|
|
12082
12152
|
*/
|
|
12083
12153
|
static calculateReferenceStats(e, t) {
|
|
12084
|
-
const n = new
|
|
12154
|
+
const n = new pt(), o = {
|
|
12085
12155
|
total: e.length,
|
|
12086
12156
|
resolved: 0,
|
|
12087
12157
|
failed: 0,
|
|
@@ -12111,7 +12181,7 @@ class Qr {
|
|
|
12111
12181
|
* 检查引用是否存在
|
|
12112
12182
|
*/
|
|
12113
12183
|
static checkReferenceExists(e, t) {
|
|
12114
|
-
const o = new
|
|
12184
|
+
const o = new pt().getResolverForRef(e);
|
|
12115
12185
|
if (!o)
|
|
12116
12186
|
return !1;
|
|
12117
12187
|
if (o.validate)
|
|
@@ -12260,7 +12330,7 @@ class cs {
|
|
|
12260
12330
|
*/
|
|
12261
12331
|
checkPerformance() {
|
|
12262
12332
|
const e = [];
|
|
12263
|
-
return this.stats.transformationTime >
|
|
12333
|
+
return this.stats.transformationTime > it.WARNING_TRANSFORMATION_TIME && e.push(`转换时间较长: ${this.stats.transformationTime.toFixed(2)}ms (警告阈值: ${it.WARNING_TRANSFORMATION_TIME}ms)`), this.stats.transformationTime > it.MAX_TRANSFORMATION_TIME && e.push(`转换时间过长: ${this.stats.transformationTime.toFixed(2)}ms (最大阈值: ${it.MAX_TRANSFORMATION_TIME}ms)`), this.stats.memoryUsage > it.MAX_MEMORY_INCREASE && e.push(`内存增加过多: ${(this.stats.memoryUsage / 1024).toFixed(2)}KB (最大阈值: ${it.MAX_MEMORY_INCREASE / 1024}KB)`), this.stats.referenceCount > it.MAX_REFERENCE_DEPTH * 10 && e.push(`引用数量较多: ${this.stats.referenceCount} (可能影响性能)`), {
|
|
12264
12334
|
passed: e.length === 0,
|
|
12265
12335
|
warnings: e
|
|
12266
12336
|
};
|
|
@@ -12457,7 +12527,7 @@ class Ic {
|
|
|
12457
12527
|
* 验证输入数据
|
|
12458
12528
|
*/
|
|
12459
12529
|
validateInput(e) {
|
|
12460
|
-
return
|
|
12530
|
+
return At.validateInput(e, {
|
|
12461
12531
|
strictMode: this.config.strictMode || this.config.validationLevel === "strict"
|
|
12462
12532
|
});
|
|
12463
12533
|
}
|
|
@@ -12843,7 +12913,7 @@ class Ic {
|
|
|
12843
12913
|
* 验证输出数据
|
|
12844
12914
|
*/
|
|
12845
12915
|
validateOutput(e) {
|
|
12846
|
-
return
|
|
12916
|
+
return At.validateOutput(e, {
|
|
12847
12917
|
strictMode: this.config.strictMode || this.config.validationLevel === "strict"
|
|
12848
12918
|
});
|
|
12849
12919
|
}
|
|
@@ -12962,7 +13032,7 @@ class Ht {
|
|
|
12962
13032
|
* 验证输入数据
|
|
12963
13033
|
*/
|
|
12964
13034
|
_validateInput(e) {
|
|
12965
|
-
return
|
|
13035
|
+
return At.validateInput(e, {
|
|
12966
13036
|
strictMode: this.config.strictMode || this.config.validationLevel === "strict"
|
|
12967
13037
|
});
|
|
12968
13038
|
}
|
|
@@ -13247,7 +13317,7 @@ class Ht {
|
|
|
13247
13317
|
* 验证输出数据
|
|
13248
13318
|
*/
|
|
13249
13319
|
_validateOutput(e) {
|
|
13250
|
-
return
|
|
13320
|
+
return At.validateOutput(e, {
|
|
13251
13321
|
strictMode: this.config.strictMode || this.config.validationLevel === "strict"
|
|
13252
13322
|
});
|
|
13253
13323
|
}
|
|
@@ -13342,7 +13412,7 @@ function zm(r) {
|
|
|
13342
13412
|
};
|
|
13343
13413
|
}
|
|
13344
13414
|
function jm(r, e = "input") {
|
|
13345
|
-
return e === "input" ?
|
|
13415
|
+
return e === "input" ? At.validateInput(r) : At.validateOutput(r);
|
|
13346
13416
|
}
|
|
13347
13417
|
function Bm(r, e, t = 100) {
|
|
13348
13418
|
const n = [];
|
|
@@ -14415,7 +14485,7 @@ function od(r) {
|
|
|
14415
14485
|
return console.log("🔍 JSON config already in system format"), r;
|
|
14416
14486
|
console.log("🔍 Converting parallelogram JSON config to system format"), console.log("📦 Input JSON config transform:", {
|
|
14417
14487
|
hasTransform: !!r.transform,
|
|
14418
|
-
type:
|
|
14488
|
+
type: bt(r.transform),
|
|
14419
14489
|
distance: Xe(r.transform),
|
|
14420
14490
|
direction: fr(r.transform)
|
|
14421
14491
|
});
|
|
@@ -14464,7 +14534,7 @@ function od(r) {
|
|
|
14464
14534
|
};
|
|
14465
14535
|
}
|
|
14466
14536
|
!e.base && r.base && (e.base = r.base), !e.height && r.height && (e.height = r.height), !e.unit && r.unit && (e.unit = r.unit);
|
|
14467
|
-
const t =
|
|
14537
|
+
const t = bt(r.transform);
|
|
14468
14538
|
return r.transform && t === "translation" ? (console.log("🔧 Processing translation transform from JSON"), console.log("📐 JSON transform details:", {
|
|
14469
14539
|
type: t,
|
|
14470
14540
|
translation: r.transform.translation,
|
|
@@ -14476,7 +14546,7 @@ function od(r) {
|
|
|
14476
14546
|
}, console.log(
|
|
14477
14547
|
"✅ Set converted.transform with distance:",
|
|
14478
14548
|
Xe(r.transform)
|
|
14479
|
-
))) : r.transform ? console.log("⚠️ JSON has transform but not translation type:",
|
|
14549
|
+
))) : r.transform ? console.log("⚠️ JSON has transform but not translation type:", bt(r.transform)) : console.log("ℹ️ No transform found in JSON config"), e.animation ? (e.animation.slider || (e.animation.slider = {
|
|
14480
14550
|
position: [0, -5],
|
|
14481
14551
|
length: 10,
|
|
14482
14552
|
orientation: "horizontal",
|
|
@@ -14507,7 +14577,7 @@ function od(r) {
|
|
|
14507
14577
|
strategy: e.strategy,
|
|
14508
14578
|
generatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
14509
14579
|
}), console.log("🎉 Conversion complete. Final converted config:"), console.log("📊 Final transform:", {
|
|
14510
|
-
type:
|
|
14580
|
+
type: bt(e.transform),
|
|
14511
14581
|
distance: Xe(e.transform),
|
|
14512
14582
|
direction: fr(e.transform)
|
|
14513
14583
|
}), console.log("📐 Final base:", e.base, "height:", e.height), console.log("🏷️ Final strategy:", e.strategy, "theme:", e.theme), e;
|
|
@@ -14528,7 +14598,7 @@ function fr(r) {
|
|
|
14528
14598
|
if (e?.config?.direction !== void 0)
|
|
14529
14599
|
return e.config.direction;
|
|
14530
14600
|
}
|
|
14531
|
-
function
|
|
14601
|
+
function bt(r) {
|
|
14532
14602
|
return r && (Array.isArray(r) ? r[0] : r)?.type || "N/A";
|
|
14533
14603
|
}
|
|
14534
14604
|
function sd(r, e, t) {
|
|
@@ -14555,7 +14625,7 @@ function sd(r, e, t) {
|
|
|
14555
14625
|
console.warn("❌ JSON-provided parallelogram config validation failed:", a.errors), console.log("📊 JSON config structure:", {
|
|
14556
14626
|
hasShapes: !!i.shapes,
|
|
14557
14627
|
hasTransform: !!i.transform,
|
|
14558
|
-
transformType:
|
|
14628
|
+
transformType: bt(i.transform),
|
|
14559
14629
|
distance: Xe(i.transform),
|
|
14560
14630
|
strategy: i.strategy,
|
|
14561
14631
|
theme: i.theme
|
|
@@ -14589,7 +14659,7 @@ function sd(r, e, t) {
|
|
|
14589
14659
|
);
|
|
14590
14660
|
}
|
|
14591
14661
|
return console.log("🔧 Final config source: generated"), console.log("📊 Final transform details:", {
|
|
14592
|
-
type:
|
|
14662
|
+
type: bt(s.transform),
|
|
14593
14663
|
direction: fr(s.transform),
|
|
14594
14664
|
distance: Xe(s.transform)
|
|
14595
14665
|
}), {
|
|
@@ -14614,7 +14684,7 @@ function sd(r, e, t) {
|
|
|
14614
14684
|
}
|
|
14615
14685
|
return r;
|
|
14616
14686
|
}
|
|
14617
|
-
const id = "4.0.0", ad = "1.0.0", ld = "mp-10506-0002-0002-G01-0001", cd = "锐角三角形面积练习", dd = "通过双旋转策略练习锐角三角形面积公式 A=½bh", fd = "掌握锐角三角形面积公式 A=½bh,掌握双旋转证明方法", ud = 1, md = "g5", hd = "三角形面积计算", gd = 1050602, pd = "锐角三角形的面积", yd = 105060201, bd = 1002, vd = "已知锐角三角形的底和高,求三角形面积", _d = "s-105-06-0002", wd = 1002, Ad = 2, Rd = ["三角形面积公式 A=½bh", "锐角三角形双旋转证明", "直角三角形组合变换"], xd = { topic: "三角形面积计算", skill: "三角形面积求解技能", tags: ["锐角三角形", "双旋转策略", "三角形面积公式"], version: "1.1.0", author: "chen-hui", strategy: "double_rotation_visual_proof" }, Sd = { question: "以下三角形面积是多少?", answerUnit: "cm²", shape: "acute_triangle", base: 6, height: 4, baseUnit: "cm", heightUnit: "cm", originX: 2, originY: 2, unit: "cm²", variables: { b: 6, h: 4, answer: 12 } }, Cd = { acute_triangle: { id: "acute_triangle", type: "polygon", vertices: [{ $ref: "point_a" }, { $ref: "point_b" }, { $ref: "point_c" }], withLabel: !0, label: { offset: [-15, -15], fontSize: 16, color: "#000000", anchorX: "middle", anchorY: "bottom" } }, left_triangle: { id: "left_triangle", type: "polygon", vertices: [{ $ref: "point_a" }, { $ref: "point_d" }, { $ref: "point_c" }] }, right_triangle: { id: "right_triangle", type: "polygon", vertices: [{ $ref: "point_b" }, { $ref: "point_d" }, { $ref: "point_c" }] }, base_segment: { id: "base_segment", type: "segment", endpoints: [{ $ref: "point_a" }, { $ref: "point_b" }] }, height_segment: { id: "height_segment", type: "segment", endpoints: [{ $ref: "point_d" }, { $ref: "point_c" }] }, left_rotation_center: { id: "left_rotation_center", type: "point", position: { x: 3.5, y: 4 } }, right_rotation_center: { id: "right_rotation_center", type: "point", position: { x: 6.5, y: 4 } }, full_rectangle: { id: "full_rectangle", type: "polygon", vertices: [{ x: 2, y: 2 }, { x: 8, y: 2 }, { x: 8, y: 6 }, { x: 2, y: 6 }] }, base_arrow: { id: "base_arrow", type: "segment", endpoints: [{ x: 2, y: 1.5 }, { x: 8, y: 1.5 }] }, height_arrow: { id: "height_arrow", type: "segment", endpoints: [{ x: 5, y: 2 }, { x: 5, y: 6 }] }, base_label_position: { id: "base_label_position", type: "point", position: { x: 5, y: 1.2 } }, height_label_position: { id: "height_label_position", type: "point", position: { x: 5.5, y: 4 } }, point_a: { id: "point_a", type: "point", position: { x: 2, y: 2 }, name: "A" }, point_b: { id: "point_b", type: "point", position: { x: 8, y: 2 }, name: "B" }, point_c: { id: "point_c", type: "point", position: { x: 5, y: 6 }, name: "C" }, point_d: { id: "point_d", type: "point", position: { x: 5, y: 2 }, name: "D" } }, Ed = { type: "card", padding: "$spacing.large", theme: "light", renderer: { showFormulaSteps: !0, interactiveAnimations: !0, validateAnswers: !0, keepAspectRatio: !0 } }, Td = { question: { layout: { layoutRef: "vertical_centered" }, items: [{ type: "text", content: "What is the area of the triangle?", styleRef: "text_heading_large" }, { type: "graph", boardRef: "default", shapes: [{ id: "main_triangle", type: "polygon", geometryRef: "acute_triangle", styleRef: "primary" }, { id: "base_line", type: "segment", geometryRef: "base_segment", styleRef: "base_highlight" }, { id: "height_line", type: "segment", geometryRef: "height_segment", styleRef: "dashed" }, { id: "base_label", type: "text", geometryRef: "base_label_position", content: "6 cm", styleRef: "label_error" }, { id: "height_label", type: "text", geometryRef: "height_label_position", content: "4 cm", styleRef: "text_primary" }] }, { type: "interactive", component: "answer_input", config: { inputType: "number", placeholder: "输入面积", unit: "cm²", submitButton: { label: "Submit", color: "$colors.success" } } }] }, remember: { layout: { layoutRef: "vertical_spaced" }, items: [{ type: "text", content: "锐角三角形面积公式", styleRef: "text_heading_large" }, { type: "formula", content: "A = \\frac{1}{2} \\times b \\times h", parts: ["A = \\frac{1}{2} \\times b \\times h", "= \\frac{1}{2} \\times 6 \\times 4", "= \\frac{1}{2} \\times 24", "= 12"], displayMode: !0, style: { fontSize: "$fonts.formula", color: "$colors.text_primary" } }] }, solve: { layout: { layoutRef: "vertical_centered" }, items: [{ type: "text", content: "解题步骤演示", styleRef: "text_heading_large" }, { type: "geometryTransform", geometryTransformRef: "double_rotation_proof" }] } }, Nd = { steps: [{ id: "exp-step-1", type: "instructionalStep", title: "识别锐角三角形的底和高", description: "确定锐角三角形的底边长度 b = 6 cm 和对应的高度 h = 4 cm。垂足将底边平分为两段。", chartConfig: { type: "graph", boardRef: "default", shapes: [{ type: "polygon", geometryRef: "acute_triangle", styleRef: "primary" }, { type: "segment", geometryRef: "base_segment", styleRef: "error" }, { type: "segment", geometryRef: "height_segment", styleRef: "dashed" }, { id: "base-label", type: "text", position: { x: 5, y: 1.4 }, content: "6 cm", styleRef: "label_error" }, { id: "height-label", type: "text", position: { x: 5.3, y: 4 }, content: "4 cm", styleRef: "label_success" }] } }, { id: "exp-step-2", type: "instructionalStep", title: "双旋转策略:分割为两个直角三角形", description: "沿高线将锐角三角形分割为两个直角三角形:左直角三角形和右直角三角形。每个直角三角形将独立旋转。", chartConfig: { type: "graph", boardRef: "default", shapes: [{ type: "polygon", geometryRef: "left_triangle", styleRef: "highlight_left" }, { type: "polygon", geometryRef: "right_triangle", styleRef: "highlight_right" }, { type: "point", geometryRef: "left_rotation_center", styleRef: "primary", size: 4 }, { type: "point", geometryRef: "right_rotation_center", styleRef: "primary", size: 4 }] } }, { id: "exp-step-3", type: "instructionalStep", title: "刚体旋转形成矩形", description: "每个直角三角形围绕其斜边中点旋转180度,形成对应的矩形。左直角三角形形成左矩形,右直角三角形形成右矩形。", chartConfig: { type: "geometryTransform", geometryTransformRef: "double_rotation_proof" } }, { id: "exp-step-4", type: "instructionalStep", title: "组合形成完整矩形并推导面积公式", description: "两个小矩形组合形成完整的大矩形,其面积为 b × h = 6 × 4 = 24 cm²。锐角三角形面积是大矩形面积的一半,即 A = ½ × b × h = 12 cm²。", chartConfig: { type: "graph", boardRef: "default", shapes: [{ type: "polygon", geometryRef: "full_rectangle", styleRef: "primary" }, { type: "polygon", geometryRef: "right_triangle", styleRef: "highlight_right" }, { type: "polygon", geometryRef: "left_triangle", styleRef: "highlight_left" }, { type: "segment", geometryRef: "base_segment", styleRef: "error" }, { type: "segment", geometryRef: "height_segment", styleRef: "dashed" }, { type: "text", position: { x: 5, y: 1.2 }, content: "Base = 6 cm", style: { fontSize: "$fonts.label", color: "$colors.error", fontWeight: "bold", anchorX: "middle" } }, { type: "text", position: { x: 5.5, y: 4 }, content: "Height = 4 cm", style: { fontSize: "$fonts.label", color: "$colors.success", fontWeight: "bold" } }] } }] }, $d = { value: 12, unit: "cm²", type: "number", tolerance: 0.1, validation: { type: "exact", allowPartial: !1 }, explanation_text: "三角形面积 = ½ × 底 × 高 = ½ × 6cm × 4cm = 12cm²", solution_steps: ["识别三角形的底和高", "应用面积公式 A = ½ × b × h", "代入数值:A = ½ × 6 × 4", "计算:A = ½ × 24 = 12", "添加单位:12 cm²"] }, kd = "2026-01-20T20:34:00Z", Od = "2026-01-20T20:34:00Z", Id = { double_rotation_proof: { id: "double_rotation_proof", description: "双旋转几何证明策略", base: 6, height: 4, unit: "cm", strategy: "double_rotation", shapes: { static: [{ id: "main_triangle", type: "polygon", geometryRef: "acute_triangle", styleRef: "primary", appearanceRef: "always_visible" }], animated: [{ id: "left_triangle", type: "polygon", geometryRef: "left_triangle", styleRef: "highlight_left", appearanceRef: "appear_at_90" }, { id: "right_triangle", type: "polygon", geometryRef: "right_triangle", styleRef: "highlight_right", appearanceRef: "appear_at_90" }] }, transform: { type: "composite", transforms: [{ transformRef: "left_rotation" }, { transformRef: "right_rotation" }], executionMode: "parallel" }, boardRef: "default", sliderRef: "slider_horizontal" } }, Md = { left_rotation: { id: "left_rotation", type: "rotation", config: { center: { x: 3.5, y: 4 }, startAngle: 0, endAngle: 3.14159, direction: "clockwise" }, targetGroup: "
|
|
14687
|
+
const id = "4.0.0", ad = "1.0.0", ld = "mp-10506-0002-0002-G01-0001", cd = "锐角三角形面积练习", dd = "通过双旋转策略练习锐角三角形面积公式 A=½bh", fd = "掌握锐角三角形面积公式 A=½bh,掌握双旋转证明方法", ud = 1, md = "g5", hd = "三角形面积计算", gd = 1050602, pd = "锐角三角形的面积", yd = 105060201, bd = 1002, vd = "已知锐角三角形的底和高,求三角形面积", _d = "s-105-06-0002", wd = 1002, Ad = 2, Rd = ["三角形面积公式 A=½bh", "锐角三角形双旋转证明", "直角三角形组合变换"], xd = { topic: "三角形面积计算", skill: "三角形面积求解技能", tags: ["锐角三角形", "双旋转策略", "三角形面积公式"], version: "1.1.0", author: "chen-hui", strategy: "double_rotation_visual_proof" }, Sd = { question: "以下三角形面积是多少?", answerUnit: "cm²", shape: "acute_triangle", base: 6, height: 4, baseUnit: "cm", heightUnit: "cm", originX: 2, originY: 2, unit: "cm²", variables: { b: 6, h: 4, answer: 12 } }, Cd = { acute_triangle: { id: "acute_triangle", type: "polygon", vertices: [{ $ref: "point_a" }, { $ref: "point_b" }, { $ref: "point_c" }], withLabel: !0, label: { offset: [-15, -15], fontSize: 16, color: "#000000", anchorX: "middle", anchorY: "bottom" } }, left_triangle: { id: "left_triangle", type: "polygon", vertices: [{ $ref: "point_a" }, { $ref: "point_d" }, { $ref: "point_c" }] }, right_triangle: { id: "right_triangle", type: "polygon", vertices: [{ $ref: "point_b" }, { $ref: "point_d" }, { $ref: "point_c" }] }, base_segment: { id: "base_segment", type: "segment", endpoints: [{ $ref: "point_a" }, { $ref: "point_b" }] }, height_segment: { id: "height_segment", type: "segment", endpoints: [{ $ref: "point_d" }, { $ref: "point_c" }] }, left_rotation_center: { id: "left_rotation_center", type: "point", position: { x: 3.5, y: 4 } }, right_rotation_center: { id: "right_rotation_center", type: "point", position: { x: 6.5, y: 4 } }, full_rectangle: { id: "full_rectangle", type: "polygon", vertices: [{ x: 2, y: 2 }, { x: 8, y: 2 }, { x: 8, y: 6 }, { x: 2, y: 6 }] }, base_arrow: { id: "base_arrow", type: "segment", endpoints: [{ x: 2, y: 1.5 }, { x: 8, y: 1.5 }] }, height_arrow: { id: "height_arrow", type: "segment", endpoints: [{ x: 5, y: 2 }, { x: 5, y: 6 }] }, base_label_position: { id: "base_label_position", type: "point", position: { x: 5, y: 1.2 } }, height_label_position: { id: "height_label_position", type: "point", position: { x: 5.5, y: 4 } }, point_a: { id: "point_a", type: "point", position: { x: 2, y: 2 }, name: "A" }, point_b: { id: "point_b", type: "point", position: { x: 8, y: 2 }, name: "B" }, point_c: { id: "point_c", type: "point", position: { x: 5, y: 6 }, name: "C" }, point_d: { id: "point_d", type: "point", position: { x: 5, y: 2 }, name: "D" } }, Ed = { type: "card", padding: "$spacing.large", theme: "light", renderer: { showFormulaSteps: !0, interactiveAnimations: !0, validateAnswers: !0, keepAspectRatio: !0 } }, Td = { question: { layout: { layoutRef: "vertical_centered" }, items: [{ type: "text", content: "What is the area of the triangle?", styleRef: "text_heading_large" }, { type: "graph", boardRef: "default", shapes: [{ id: "main_triangle", type: "polygon", geometryRef: "acute_triangle", styleRef: "primary" }, { id: "base_line", type: "segment", geometryRef: "base_segment", styleRef: "base_highlight" }, { id: "height_line", type: "segment", geometryRef: "height_segment", styleRef: "dashed" }, { id: "base_label", type: "text", geometryRef: "base_label_position", content: "6 cm", styleRef: "label_error" }, { id: "height_label", type: "text", geometryRef: "height_label_position", content: "4 cm", styleRef: "text_primary" }] }, { type: "interactive", component: "answer_input", config: { inputType: "number", placeholder: "输入面积", unit: "cm²", submitButton: { label: "Submit", color: "$colors.success" } } }] }, remember: { layout: { layoutRef: "vertical_spaced" }, items: [{ type: "text", content: "锐角三角形面积公式", styleRef: "text_heading_large" }, { type: "formula", content: "A = \\frac{1}{2} \\times b \\times h", parts: ["A = \\frac{1}{2} \\times b \\times h", "= \\frac{1}{2} \\times 6 \\times 4", "= \\frac{1}{2} \\times 24", "= 12"], displayMode: !0, style: { fontSize: "$fonts.formula", color: "$colors.text_primary" } }] }, solve: { layout: { layoutRef: "vertical_centered" }, items: [{ type: "text", content: "解题步骤演示", styleRef: "text_heading_large" }, { type: "geometryTransform", geometryTransformRef: "double_rotation_proof" }] } }, Nd = { steps: [{ id: "exp-step-1", type: "instructionalStep", title: "识别锐角三角形的底和高", description: "确定锐角三角形的底边长度 b = 6 cm 和对应的高度 h = 4 cm。垂足将底边平分为两段。", chartConfig: { type: "graph", boardRef: "default", shapes: [{ type: "polygon", geometryRef: "acute_triangle", styleRef: "primary" }, { type: "segment", geometryRef: "base_segment", styleRef: "error" }, { type: "segment", geometryRef: "height_segment", styleRef: "dashed" }, { id: "base-label", type: "text", position: { x: 5, y: 1.4 }, content: "6 cm", styleRef: "label_error" }, { id: "height-label", type: "text", position: { x: 5.3, y: 4 }, content: "4 cm", styleRef: "label_success" }] } }, { id: "exp-step-2", type: "instructionalStep", title: "双旋转策略:分割为两个直角三角形", description: "沿高线将锐角三角形分割为两个直角三角形:左直角三角形和右直角三角形。每个直角三角形将独立旋转。", chartConfig: { type: "graph", boardRef: "default", shapes: [{ type: "polygon", geometryRef: "left_triangle", styleRef: "highlight_left" }, { type: "polygon", geometryRef: "right_triangle", styleRef: "highlight_right" }, { type: "point", geometryRef: "left_rotation_center", styleRef: "primary", size: 4 }, { type: "point", geometryRef: "right_rotation_center", styleRef: "primary", size: 4 }] } }, { id: "exp-step-3", type: "instructionalStep", title: "刚体旋转形成矩形", description: "每个直角三角形围绕其斜边中点旋转180度,形成对应的矩形。左直角三角形形成左矩形,右直角三角形形成右矩形。", chartConfig: { type: "geometryTransform", geometryTransformRef: "double_rotation_proof" } }, { id: "exp-step-4", type: "instructionalStep", title: "组合形成完整矩形并推导面积公式", description: "两个小矩形组合形成完整的大矩形,其面积为 b × h = 6 × 4 = 24 cm²。锐角三角形面积是大矩形面积的一半,即 A = ½ × b × h = 12 cm²。", chartConfig: { type: "graph", boardRef: "default", shapes: [{ type: "polygon", geometryRef: "full_rectangle", styleRef: "primary" }, { type: "polygon", geometryRef: "right_triangle", styleRef: "highlight_right" }, { type: "polygon", geometryRef: "left_triangle", styleRef: "highlight_left" }, { type: "segment", geometryRef: "base_segment", styleRef: "error" }, { type: "segment", geometryRef: "height_segment", styleRef: "dashed" }, { type: "text", position: { x: 5, y: 1.2 }, content: "Base = 6 cm", style: { fontSize: "$fonts.label", color: "$colors.error", fontWeight: "bold", anchorX: "middle" } }, { type: "text", position: { x: 5.5, y: 4 }, content: "Height = 4 cm", style: { fontSize: "$fonts.label", color: "$colors.success", fontWeight: "bold" } }] } }] }, $d = { value: 12, unit: "cm²", type: "number", tolerance: 0.1, validation: { type: "exact", allowPartial: !1 }, explanation_text: "三角形面积 = ½ × 底 × 高 = ½ × 6cm × 4cm = 12cm²", solution_steps: ["识别三角形的底和高", "应用面积公式 A = ½ × b × h", "代入数值:A = ½ × 6 × 4", "计算:A = ½ × 24 = 12", "添加单位:12 cm²"] }, kd = "2026-01-20T20:34:00Z", Od = "2026-01-20T20:34:00Z", Id = { double_rotation_proof: { id: "double_rotation_proof", description: "双旋转几何证明策略", base: 6, height: 4, unit: "cm", strategy: "double_rotation", shapes: { static: [{ id: "main_triangle", type: "polygon", geometryRef: "acute_triangle", styleRef: "primary", appearanceRef: "always_visible" }], animated: [{ id: "left_triangle", type: "polygon", geometryRef: "left_triangle", styleRef: "highlight_left", appearanceRef: "appear_at_90" }, { id: "right_triangle", type: "polygon", geometryRef: "right_triangle", styleRef: "highlight_right", appearanceRef: "appear_at_90" }] }, transform: { type: "composite", transforms: [{ transformRef: "left_rotation" }, { transformRef: "right_rotation" }], executionMode: "parallel" }, boardRef: "default", sliderRef: "slider_horizontal" } }, Md = { left_rotation: { id: "left_rotation", type: "rotation", config: { center: { x: 3.5, y: 4 }, startAngle: 0, endAngle: 3.14159, direction: "clockwise" }, targetGroup: "left_triangle" }, right_rotation: { id: "right_rotation", type: "rotation", config: { center: { x: 6.5, y: 4 }, startAngle: 0, endAngle: 3.14159, direction: "counterclockwise" }, targetGroup: "right_triangle" } }, Fd = {
|
|
14618
14688
|
schema_version: id,
|
|
14619
14689
|
config_version: ad,
|
|
14620
14690
|
math_prob_id: ld,
|
|
@@ -15534,30 +15604,30 @@ function nr(r, e) {
|
|
|
15534
15604
|
function kf(r, e) {
|
|
15535
15605
|
return r.map(e).join("");
|
|
15536
15606
|
}
|
|
15537
|
-
var kr = 1,
|
|
15607
|
+
var kr = 1, Rt = 1, xs = 0, ke = 0, he = 0, St = "";
|
|
15538
15608
|
function Or(r, e, t, n, o, s, i) {
|
|
15539
|
-
return { value: r, root: e, parent: t, type: n, props: o, children: s, line: kr, column:
|
|
15609
|
+
return { value: r, root: e, parent: t, type: n, props: o, children: s, line: kr, column: Rt, length: i, return: "" };
|
|
15540
15610
|
}
|
|
15541
|
-
function
|
|
15611
|
+
function $t(r, e) {
|
|
15542
15612
|
return Tf(Or("", null, null, "", null, null, 0), r, { length: -r.length }, e);
|
|
15543
15613
|
}
|
|
15544
15614
|
function Of() {
|
|
15545
15615
|
return he;
|
|
15546
15616
|
}
|
|
15547
15617
|
function If() {
|
|
15548
|
-
return he = ke > 0 ? be(
|
|
15618
|
+
return he = ke > 0 ? be(St, --ke) : 0, Rt--, he === 10 && (Rt = 1, kr--), he;
|
|
15549
15619
|
}
|
|
15550
15620
|
function Fe() {
|
|
15551
|
-
return he = ke < xs ? be(
|
|
15621
|
+
return he = ke < xs ? be(St, ke++) : 0, Rt++, he === 10 && (Rt = 1, kr++), he;
|
|
15552
15622
|
}
|
|
15553
15623
|
function He() {
|
|
15554
|
-
return be(
|
|
15624
|
+
return be(St, ke);
|
|
15555
15625
|
}
|
|
15556
15626
|
function mr() {
|
|
15557
15627
|
return ke;
|
|
15558
15628
|
}
|
|
15559
15629
|
function Xt(r, e) {
|
|
15560
|
-
return Mt(
|
|
15630
|
+
return Mt(St, r, e);
|
|
15561
15631
|
}
|
|
15562
15632
|
function Ft(r) {
|
|
15563
15633
|
switch (r) {
|
|
@@ -15598,10 +15668,10 @@ function Ft(r) {
|
|
|
15598
15668
|
return 0;
|
|
15599
15669
|
}
|
|
15600
15670
|
function Ss(r) {
|
|
15601
|
-
return kr =
|
|
15671
|
+
return kr = Rt = 1, xs = We(St = r), ke = 0, [];
|
|
15602
15672
|
}
|
|
15603
15673
|
function Cs(r) {
|
|
15604
|
-
return
|
|
15674
|
+
return St = "", r;
|
|
15605
15675
|
}
|
|
15606
15676
|
function hr(r) {
|
|
15607
15677
|
return Rs(Xt(ke - 1, tn(r === 91 ? r + 2 : r === 40 ? r + 1 : r)));
|
|
@@ -15770,7 +15840,7 @@ function Uf(r, e, t) {
|
|
|
15770
15840
|
function Zn(r, e, t, n) {
|
|
15771
15841
|
return Or(r, e, t, _n, Mt(r, 0, n), Mt(r, n + 1, -1), n);
|
|
15772
15842
|
}
|
|
15773
|
-
function
|
|
15843
|
+
function vt(r, e) {
|
|
15774
15844
|
for (var t = "", n = wn(r), o = 0; o < n; o++)
|
|
15775
15845
|
t += e(r[o], o, r, e) || "";
|
|
15776
15846
|
return t;
|
|
@@ -15785,11 +15855,11 @@ function Gf(r, e, t, n) {
|
|
|
15785
15855
|
case ws:
|
|
15786
15856
|
return "";
|
|
15787
15857
|
case As:
|
|
15788
|
-
return r.return = r.value + "{" +
|
|
15858
|
+
return r.return = r.value + "{" + vt(r.children, n) + "}";
|
|
15789
15859
|
case vn:
|
|
15790
15860
|
r.value = r.props.join(",");
|
|
15791
15861
|
}
|
|
15792
|
-
return We(t =
|
|
15862
|
+
return We(t = vt(r.children, n)) ? r.return = r.value + "{" + t + "}" : "";
|
|
15793
15863
|
}
|
|
15794
15864
|
function zf(r) {
|
|
15795
15865
|
var e = wn(r);
|
|
@@ -16006,7 +16076,7 @@ var Kf = function(e, t, n, o) {
|
|
|
16006
16076
|
e.return = Es(e.value, e.length);
|
|
16007
16077
|
break;
|
|
16008
16078
|
case As:
|
|
16009
|
-
return
|
|
16079
|
+
return vt([$t(e, {
|
|
16010
16080
|
value: K(e.value, "@", "@" + H)
|
|
16011
16081
|
})], o);
|
|
16012
16082
|
case vn:
|
|
@@ -16015,16 +16085,16 @@ var Kf = function(e, t, n, o) {
|
|
|
16015
16085
|
// :read-(only|write)
|
|
16016
16086
|
case ":read-only":
|
|
16017
16087
|
case ":read-write":
|
|
16018
|
-
return
|
|
16088
|
+
return vt([$t(e, {
|
|
16019
16089
|
props: [K(s, /:(read-\w+)/, ":" + _r + "$1")]
|
|
16020
16090
|
})], o);
|
|
16021
16091
|
// :placeholder
|
|
16022
16092
|
case "::placeholder":
|
|
16023
|
-
return
|
|
16093
|
+
return vt([$t(e, {
|
|
16024
16094
|
props: [K(s, /:(plac\w+)/, ":" + H + "input-$1")]
|
|
16025
|
-
}),
|
|
16095
|
+
}), $t(e, {
|
|
16026
16096
|
props: [K(s, /:(plac\w+)/, ":" + _r + "$1")]
|
|
16027
|
-
}),
|
|
16097
|
+
}), $t(e, {
|
|
16028
16098
|
props: [K(s, /:(plac\w+)/, Re + "input-$1")]
|
|
16029
16099
|
})], o);
|
|
16030
16100
|
}
|
|
@@ -16056,7 +16126,7 @@ var Kf = function(e, t, n, o) {
|
|
|
16056
16126
|
var d, u = [Gf, jf(function(g) {
|
|
16057
16127
|
d.insert(g);
|
|
16058
16128
|
})], y = zf(l.concat(o, u)), m = function(p) {
|
|
16059
|
-
return
|
|
16129
|
+
return vt(Lf(p), y);
|
|
16060
16130
|
};
|
|
16061
16131
|
c = function(p, b, S, x) {
|
|
16062
16132
|
d = S, m(p ? p + "{" + b.styles + "}" : b.styles), x && (h.inserted[b.name] = !0);
|
|
@@ -16205,13 +16275,13 @@ function Qf() {
|
|
|
16205
16275
|
function Je(R) {
|
|
16206
16276
|
return C(R) === d;
|
|
16207
16277
|
}
|
|
16208
|
-
function
|
|
16278
|
+
function rt(R) {
|
|
16209
16279
|
return C(R) === n;
|
|
16210
16280
|
}
|
|
16211
|
-
function
|
|
16281
|
+
function ht(R) {
|
|
16212
16282
|
return C(R) === h;
|
|
16213
16283
|
}
|
|
16214
|
-
function
|
|
16284
|
+
function Et(R) {
|
|
16215
16285
|
return C(R) === m;
|
|
16216
16286
|
}
|
|
16217
16287
|
function Ir(R) {
|
|
@@ -16226,7 +16296,7 @@ function Qf() {
|
|
|
16226
16296
|
function E(R) {
|
|
16227
16297
|
return C(R) === u;
|
|
16228
16298
|
}
|
|
16229
|
-
ee.AsyncMode = w, ee.ConcurrentMode = O, ee.ContextConsumer = A, ee.ContextProvider = P, ee.Element = $, ee.ForwardRef = k, ee.Fragment = Y, ee.Lazy = J, ee.Memo = M, ee.Portal = U, ee.Profiler = re, ee.StrictMode = I, ee.Suspense = ve, ee.isAsyncMode = q, ee.isConcurrentMode = ge, ee.isContextConsumer = ue, ee.isContextProvider = _e, ee.isElement = Oe, ee.isForwardRef = Je, ee.isFragment =
|
|
16299
|
+
ee.AsyncMode = w, ee.ConcurrentMode = O, ee.ContextConsumer = A, ee.ContextProvider = P, ee.Element = $, ee.ForwardRef = k, ee.Fragment = Y, ee.Lazy = J, ee.Memo = M, ee.Portal = U, ee.Profiler = re, ee.StrictMode = I, ee.Suspense = ve, ee.isAsyncMode = q, ee.isConcurrentMode = ge, ee.isContextConsumer = ue, ee.isContextProvider = _e, ee.isElement = Oe, ee.isForwardRef = Je, ee.isFragment = rt, ee.isLazy = ht, ee.isMemo = Et, ee.isPortal = Ir, ee.isProfiler = Rn, ee.isStrictMode = N, ee.isSuspense = E, ee.isValidElementType = x, ee.typeOf = C;
|
|
16230
16300
|
})()), ee;
|
|
16231
16301
|
}
|
|
16232
16302
|
var ro;
|
|
@@ -17349,11 +17419,13 @@ const vu = "/api/v1/content", _u = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2V
|
|
|
17349
17419
|
/* @__PURE__ */ f("h3", { className: "error-title", children: "加载失败" }),
|
|
17350
17420
|
/* @__PURE__ */ f("p", { className: "error-message", children: l.error }),
|
|
17351
17421
|
/* @__PURE__ */ f(
|
|
17352
|
-
|
|
17422
|
+
tt,
|
|
17353
17423
|
{
|
|
17354
17424
|
onClick: () => {
|
|
17355
17425
|
d({ loading: !1, error: null, initialized: !1 }), y((P) => P + 1);
|
|
17356
17426
|
},
|
|
17427
|
+
intent: "retry",
|
|
17428
|
+
useNewClassName: !0,
|
|
17357
17429
|
className: "retry-button",
|
|
17358
17430
|
"data-testid": "retry-button",
|
|
17359
17431
|
"aria-label": "重新加载练习内容",
|
|
@@ -17532,7 +17604,7 @@ const vu = "/api/v1/content", _u = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2V
|
|
|
17532
17604
|
)
|
|
17533
17605
|
] })
|
|
17534
17606
|
] });
|
|
17535
|
-
},
|
|
17607
|
+
}, Ct = Lt((r) => ({
|
|
17536
17608
|
// 初始状态
|
|
17537
17609
|
currentScene: "question",
|
|
17538
17610
|
userAnswer: "",
|
|
@@ -17561,7 +17633,7 @@ const vu = "/api/v1/content", _u = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2V
|
|
|
17561
17633
|
},
|
|
17562
17634
|
// 提交答案 - 专门处理小数答案验证
|
|
17563
17635
|
submitAnswer: (e) => {
|
|
17564
|
-
const t =
|
|
17636
|
+
const t = Ct.getState();
|
|
17565
17637
|
if (!t.problemData) {
|
|
17566
17638
|
r({
|
|
17567
17639
|
validationError: "问题数据未加载,请刷新页面重试"
|
|
@@ -17598,7 +17670,7 @@ const vu = "/api/v1/content", _u = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2V
|
|
|
17598
17670
|
validationError: null
|
|
17599
17671
|
});
|
|
17600
17672
|
}
|
|
17601
|
-
})), Gu = () =>
|
|
17673
|
+
})), Gu = () => Ct((r) => r.currentScene), zu = () => Ct((r) => r.userAnswer), ju = () => Ct((r) => r.showAnswerForm), Bu = () => Ct((r) => r.validationError), Vu = () => Ct(
|
|
17602
17674
|
on((r) => ({
|
|
17603
17675
|
updateUserAnswer: r.updateUserAnswer,
|
|
17604
17676
|
submitAnswer: r.submitAnswer,
|
|
@@ -18307,7 +18379,7 @@ export {
|
|
|
18307
18379
|
km as AbilityAssessmentDashboard,
|
|
18308
18380
|
Pl as AbilityProgressBar,
|
|
18309
18381
|
mh as AreaGeometrySessionPage,
|
|
18310
|
-
|
|
18382
|
+
tt as Button,
|
|
18311
18383
|
Zs as ContentAccordion,
|
|
18312
18384
|
Em as DEFAULT_IXL_CONFIG,
|
|
18313
18385
|
Zm as DecimalNumberRecognitionSessionPage,
|
|
@@ -18351,7 +18423,7 @@ export {
|
|
|
18351
18423
|
Km as TriangleAreaCalculationSessionPage,
|
|
18352
18424
|
Fa as UserProfile,
|
|
18353
18425
|
Wm as VERSION,
|
|
18354
|
-
|
|
18426
|
+
At as ValidationManager,
|
|
18355
18427
|
Mc as adaptGeometryData,
|
|
18356
18428
|
Mc as adaptGeometryDataAsync,
|
|
18357
18429
|
Kt as adaptGeometryDataSync,
|
|
@@ -18408,7 +18480,7 @@ export {
|
|
|
18408
18480
|
Do as useHundredChartStore,
|
|
18409
18481
|
dl as useHundredChartValue,
|
|
18410
18482
|
$l as useIXLStyle,
|
|
18411
|
-
|
|
18483
|
+
mt as useMathPracticeSessionStore,
|
|
18412
18484
|
Lm as useProblemData,
|
|
18413
18485
|
Ol as useResponsive,
|
|
18414
18486
|
Xo as useSessionActions,
|