@airalogy/aimd-recorder 1.16.0 → 1.18.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.
Files changed (110) hide show
  1. package/README.md +11 -10
  2. package/README.zh-CN.md +11 -10
  3. package/dist/AimdCodeField-BQUuM-EF.js +182 -0
  4. package/dist/{AimdDnaSequenceField-CPyMqIVh.js → AimdDnaSequenceField-KZU2Zj3E.js} +2 -2
  5. package/dist/{AimdEditor.vue_vue_type_style_index_0_lang-lyHIpch9.js → AimdEditor.vue_vue_type_style_index_0_lang-CzfYPp5r.js} +3924 -3831
  6. package/dist/AimdMarkdownField-t2d8uOeU.js +254 -0
  7. package/dist/AimdMarkdownNoteField-_h1oZSwH.js +259 -0
  8. package/dist/{_commonjsHelpers-CZXJ37nu.js → _commonjsHelpers-B5RozER-.js} +2 -2
  9. package/dist/aimd-recorder.css +1 -1
  10. package/dist/arc-DS_ocYoe.js +83 -0
  11. package/dist/architectureDiagram-3BPJPVTR-Dq2W8_tb.js +4692 -0
  12. package/dist/blockDiagram-GPEHLZMM-B4hnSAF_.js +2425 -0
  13. package/dist/c4Diagram-AAUBKEIU-CbffqNLY.js +1577 -0
  14. package/dist/channel-CtXnYrAk.js +5 -0
  15. package/dist/chunk-2J33WTMH-CROScrt5.js +19 -0
  16. package/dist/chunk-4BX2VUAB-DTmsQu5_.js +8 -0
  17. package/dist/chunk-55IACEB6-B5wDJzeX.js +8 -0
  18. package/dist/chunk-727SXJPM-CfyltY6o.js +1528 -0
  19. package/dist/chunk-AQP2D5EJ-B8274EYy.js +1387 -0
  20. package/dist/chunk-FMBD7UC4-CT_FK-SH.js +19 -0
  21. package/dist/chunk-ND2GUHAM-g9GulPi-.js +68 -0
  22. package/dist/chunk-QZHKN3VN-Di5HEktz.js +15 -0
  23. package/dist/classDiagram-4FO5ZUOK-BVUr246k.js +16 -0
  24. package/dist/classDiagram-v2-Q7XG4LA2-BVUr246k.js +16 -0
  25. package/dist/components.js +3365 -2216
  26. package/dist/composables.js +92 -68
  27. package/dist/cose-bilkent-S5V4N54A-GJ4IOO6v.js +2609 -0
  28. package/dist/cytoscape.esm-r59gEWFs.js +18710 -0
  29. package/dist/dagre-BM42HDAG-oL7Br44o.js +445 -0
  30. package/dist/defaultLocale-BgPVtth8.js +171 -0
  31. package/dist/diagram-2AECGRRQ-DtoCG_N4.js +217 -0
  32. package/dist/diagram-5GNKFQAL-f8QNdS7L.js +123 -0
  33. package/dist/diagram-KO2AKTUF-CsJOW_AX.js +461 -0
  34. package/dist/diagram-LMA3HP47-xmEKNZ7y.js +142 -0
  35. package/dist/diagram-OG6HWLK6-unpC7vo8.js +528 -0
  36. package/dist/erDiagram-TEJ5UH35-BGzFnCJD.js +899 -0
  37. package/dist/flowDiagram-I6XJVG4X-LBFhDnOs.js +1628 -0
  38. package/dist/ganttDiagram-6RSMTGT7-CFBc-jPD.js +2707 -0
  39. package/dist/gitGraphDiagram-PVQCEYII-BLduh-Rb.js +815 -0
  40. package/dist/graph-DdlKE625.js +1510 -0
  41. package/dist/index.js +104 -80
  42. package/dist/infoDiagram-5YYISTIA-CLQQI6zM.js +24 -0
  43. package/dist/init-DjUOC4st.js +16 -0
  44. package/dist/ishikawaDiagram-YF4QCWOH-CStdYBmW.js +621 -0
  45. package/dist/journeyDiagram-JHISSGLW-B6mRTzoE.js +834 -0
  46. package/dist/kanban-definition-UN3LZRKU-C-vnN5v4.js +724 -0
  47. package/dist/katex-DNob3HGn.js +11690 -0
  48. package/dist/layout-DDt0fz-M.js +1703 -0
  49. package/dist/linear-C-IAFdOt.js +259 -0
  50. package/dist/mermaid.core-CuZ3nINf.js +15940 -0
  51. package/dist/mindmap-definition-RKZ34NQL-TSZ1Vb3z.js +827 -0
  52. package/dist/ordinal-B6-f3MAq.js +61 -0
  53. package/dist/pieDiagram-4H26LBE5-DYok-1-k.js +163 -0
  54. package/dist/quadrantDiagram-W4KKPZXB-Cg856sbH.js +1024 -0
  55. package/dist/requirementDiagram-4Y6WPE33-BN9fGdlJ.js +882 -0
  56. package/dist/sankeyDiagram-5OEKKPKP-CDqTgonY.js +847 -0
  57. package/dist/sequenceDiagram-3UESZ5HK-Chjrc0-W.js +2891 -0
  58. package/dist/stateDiagram-AJRCARHV-DRyLHrdr.js +263 -0
  59. package/dist/stateDiagram-v2-BHNVJYJU-CZTIDHid.js +16 -0
  60. package/dist/timeline-definition-PNZ67QCA-Bc3D9AAG.js +1055 -0
  61. package/dist/{useFieldRendering-Dh6Kib_0.js → useCodeBlockRendering-qA6gj4vz.js} +3041 -2255
  62. package/dist/useMonacoAutoHeight-D4T-El3J.js +66 -0
  63. package/dist/vennDiagram-CIIHVFJN-CYAul48m.js +1557 -0
  64. package/dist/wardley-L42UT6IY-D7b2ujEZ.js +22512 -0
  65. package/dist/wardleyDiagram-YWT4CUSO-B7Tg0MG9.js +675 -0
  66. package/dist/xychartDiagram-2RQKCTM6-xWYVEqth.js +1342 -0
  67. package/package.json +8 -7
  68. package/src/__tests__/assigner-runner-dependent-data.test.ts +32 -0
  69. package/src/__tests__/markdown-field.test.ts +150 -1
  70. package/src/__tests__/markdown-note-field.test.ts +86 -3
  71. package/src/__tests__/quiz-recorder.test.ts +47 -0
  72. package/src/__tests__/recorder-assigner-control.test.ts +844 -0
  73. package/src/__tests__/recorder-check-field.test.ts +103 -0
  74. package/src/__tests__/recorder-editor.test.ts +17 -0
  75. package/src/__tests__/recorder-markdown-assigner-integration.test.ts +49 -0
  76. package/src/__tests__/step-field.test.ts +87 -4
  77. package/src/__tests__/type-plugins.test.ts +1 -0
  78. package/src/__tests__/var-field-render.test.ts +741 -1
  79. package/src/components/AimdCodeField.vue +24 -5
  80. package/src/components/AimdMarkdownField.vue +548 -11
  81. package/src/components/AimdMarkdownNoteField.vue +241 -30
  82. package/src/components/AimdQuizOptionFollowups.vue +121 -0
  83. package/src/components/AimdQuizRecorder.vue +79 -148
  84. package/src/components/AimdRecorder.vue +1620 -98
  85. package/src/components/AimdRecorderEditor.vue +276 -8
  86. package/src/components/AimdRecorderWysiwygFieldHost.vue +6 -0
  87. package/src/components/AimdRecorderWysiwygSurface.vue +32 -0
  88. package/src/components/AimdStepCheckField.vue +205 -51
  89. package/src/components/AimdVarField.vue +694 -25
  90. package/src/components/AimdVarTableField.vue +283 -110
  91. package/src/components/icons/AimdAssignerCalculatorIcon.vue +18 -0
  92. package/src/components/icons/AimdAssignerCloudStatusIcon.vue +22 -0
  93. package/src/components/recorderMilkdownPlugin.ts +14 -0
  94. package/src/composables/__tests__/useRecordState.test.ts +114 -0
  95. package/src/composables/__tests__/useVarHelpers.test.ts +133 -0
  96. package/src/composables/index.ts +27 -1
  97. package/src/composables/useAssignerRunner.ts +376 -0
  98. package/src/composables/useCodeBlockRendering.ts +51 -0
  99. package/src/composables/useFieldRendering.ts +32 -4
  100. package/src/composables/useMonacoAutoHeight.ts +127 -0
  101. package/src/composables/useRecordState.ts +40 -14
  102. package/src/composables/useVarHelpers.ts +377 -9
  103. package/src/index.ts +13 -0
  104. package/src/locales.ts +47 -2
  105. package/src/styles/aimd.css +171 -6
  106. package/src/type-plugins.ts +7 -0
  107. package/src/types.ts +93 -2
  108. package/dist/AimdCodeField-DC3DPvgc.js +0 -172
  109. package/dist/AimdMarkdownField-CX71bOdX.js +0 -67
  110. package/dist/AimdMarkdownNoteField--ssNIQfG.js +0 -186
@@ -0,0 +1,61 @@
1
+ import { i as a } from "./init-DjUOC4st.js";
2
+ class o extends Map {
3
+ constructor(n, t = g) {
4
+ if (super(), Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: t } }), n != null) for (const [r, s] of n) this.set(r, s);
5
+ }
6
+ get(n) {
7
+ return super.get(c(this, n));
8
+ }
9
+ has(n) {
10
+ return super.has(c(this, n));
11
+ }
12
+ set(n, t) {
13
+ return super.set(l(this, n), t);
14
+ }
15
+ delete(n) {
16
+ return super.delete(p(this, n));
17
+ }
18
+ }
19
+ function c({ _intern: e, _key: n }, t) {
20
+ const r = n(t);
21
+ return e.has(r) ? e.get(r) : t;
22
+ }
23
+ function l({ _intern: e, _key: n }, t) {
24
+ const r = n(t);
25
+ return e.has(r) ? e.get(r) : (e.set(r, t), t);
26
+ }
27
+ function p({ _intern: e, _key: n }, t) {
28
+ const r = n(t);
29
+ return e.has(r) && (t = e.get(r), e.delete(r)), t;
30
+ }
31
+ function g(e) {
32
+ return e !== null && typeof e == "object" ? e.valueOf() : e;
33
+ }
34
+ const f = /* @__PURE__ */ Symbol("implicit");
35
+ function h() {
36
+ var e = new o(), n = [], t = [], r = f;
37
+ function s(u) {
38
+ let i = e.get(u);
39
+ if (i === void 0) {
40
+ if (r !== f) return r;
41
+ e.set(u, i = n.push(u) - 1);
42
+ }
43
+ return t[i % t.length];
44
+ }
45
+ return s.domain = function(u) {
46
+ if (!arguments.length) return n.slice();
47
+ n = [], e = new o();
48
+ for (const i of u)
49
+ e.has(i) || e.set(i, n.push(i) - 1);
50
+ return s;
51
+ }, s.range = function(u) {
52
+ return arguments.length ? (t = Array.from(u), s) : t.slice();
53
+ }, s.unknown = function(u) {
54
+ return arguments.length ? (r = u, s) : r;
55
+ }, s.copy = function() {
56
+ return h(n, t).unknown(r);
57
+ }, a.apply(s, arguments), s;
58
+ }
59
+ export {
60
+ h as o
61
+ };
@@ -0,0 +1,163 @@
1
+ import { Q as S, T as R, b2 as J, g as K, s as Y, a as tt, b as et, t as at, q as nt, _ as d, l as W, c as rt, H as it, L as st, a4 as ot, e as lt, A as ct, I as ut } from "./mermaid.core-CuZ3nINf.js";
2
+ import { p as dt } from "./chunk-4BX2VUAB-DTmsQu5_.js";
3
+ import { p as pt } from "./wardley-L42UT6IY-D7b2ujEZ.js";
4
+ import { d as P } from "./arc-DS_ocYoe.js";
5
+ import { o as gt } from "./ordinal-B6-f3MAq.js";
6
+ function ft(t, a) {
7
+ return a < t ? -1 : a > t ? 1 : a >= t ? 0 : NaN;
8
+ }
9
+ function ht(t) {
10
+ return t;
11
+ }
12
+ function mt() {
13
+ var t = ht, a = ft, f = null, y = S(0), s = S(R), p = S(0);
14
+ function o(e) {
15
+ var r, l = (e = J(e)).length, g, h, v = 0, c = new Array(l), i = new Array(l), x = +y.apply(this, arguments), w = Math.min(R, Math.max(-R, s.apply(this, arguments) - x)), m, D = Math.min(Math.abs(w) / l, p.apply(this, arguments)), $ = D * (w < 0 ? -1 : 1), u;
16
+ for (r = 0; r < l; ++r)
17
+ (u = i[c[r] = r] = +t(e[r], r, e)) > 0 && (v += u);
18
+ for (a != null ? c.sort(function(A, C) {
19
+ return a(i[A], i[C]);
20
+ }) : f != null && c.sort(function(A, C) {
21
+ return f(e[A], e[C]);
22
+ }), r = 0, h = v ? (w - l * $) / v : 0; r < l; ++r, x = m)
23
+ g = c[r], u = i[g], m = x + (u > 0 ? u * h : 0) + $, i[g] = {
24
+ data: e[g],
25
+ index: r,
26
+ value: u,
27
+ startAngle: x,
28
+ endAngle: m,
29
+ padAngle: D
30
+ };
31
+ return i;
32
+ }
33
+ return o.value = function(e) {
34
+ return arguments.length ? (t = typeof e == "function" ? e : S(+e), o) : t;
35
+ }, o.sortValues = function(e) {
36
+ return arguments.length ? (a = e, f = null, o) : a;
37
+ }, o.sort = function(e) {
38
+ return arguments.length ? (f = e, a = null, o) : f;
39
+ }, o.startAngle = function(e) {
40
+ return arguments.length ? (y = typeof e == "function" ? e : S(+e), o) : y;
41
+ }, o.endAngle = function(e) {
42
+ return arguments.length ? (s = typeof e == "function" ? e : S(+e), o) : s;
43
+ }, o.padAngle = function(e) {
44
+ return arguments.length ? (p = typeof e == "function" ? e : S(+e), o) : p;
45
+ }, o;
46
+ }
47
+ var vt = ut.pie, z = {
48
+ sections: /* @__PURE__ */ new Map(),
49
+ showData: !1
50
+ }, T = z.sections, F = z.showData, xt = structuredClone(vt), St = /* @__PURE__ */ d(() => structuredClone(xt), "getConfig"), yt = /* @__PURE__ */ d(() => {
51
+ T = /* @__PURE__ */ new Map(), F = z.showData, ct();
52
+ }, "clear"), wt = /* @__PURE__ */ d(({ label: t, value: a }) => {
53
+ if (a < 0)
54
+ throw new Error(
55
+ `"${t}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`
56
+ );
57
+ T.has(t) || (T.set(t, a), W.debug(`added new section: ${t}, with value: ${a}`));
58
+ }, "addSection"), At = /* @__PURE__ */ d(() => T, "getSections"), Ct = /* @__PURE__ */ d((t) => {
59
+ F = t;
60
+ }, "setShowData"), Dt = /* @__PURE__ */ d(() => F, "getShowData"), _ = {
61
+ getConfig: St,
62
+ clear: yt,
63
+ setDiagramTitle: nt,
64
+ getDiagramTitle: at,
65
+ setAccTitle: et,
66
+ getAccTitle: tt,
67
+ setAccDescription: Y,
68
+ getAccDescription: K,
69
+ addSection: wt,
70
+ getSections: At,
71
+ setShowData: Ct,
72
+ getShowData: Dt
73
+ }, $t = /* @__PURE__ */ d((t, a) => {
74
+ dt(t, a), a.setShowData(t.showData), t.sections.map(a.addSection);
75
+ }, "populateDb"), Tt = {
76
+ parse: /* @__PURE__ */ d(async (t) => {
77
+ const a = await pt("pie", t);
78
+ W.debug(a), $t(a, _);
79
+ }, "parse")
80
+ }, bt = /* @__PURE__ */ d((t) => `
81
+ .pieCircle{
82
+ stroke: ${t.pieStrokeColor};
83
+ stroke-width : ${t.pieStrokeWidth};
84
+ opacity : ${t.pieOpacity};
85
+ }
86
+ .pieOuterCircle{
87
+ stroke: ${t.pieOuterStrokeColor};
88
+ stroke-width: ${t.pieOuterStrokeWidth};
89
+ fill: none;
90
+ }
91
+ .pieTitleText {
92
+ text-anchor: middle;
93
+ font-size: ${t.pieTitleTextSize};
94
+ fill: ${t.pieTitleTextColor};
95
+ font-family: ${t.fontFamily};
96
+ }
97
+ .slice {
98
+ font-family: ${t.fontFamily};
99
+ fill: ${t.pieSectionTextColor};
100
+ font-size:${t.pieSectionTextSize};
101
+ // fill: white;
102
+ }
103
+ .legend text {
104
+ fill: ${t.pieLegendTextColor};
105
+ font-family: ${t.fontFamily};
106
+ font-size: ${t.pieLegendTextSize};
107
+ }
108
+ `, "getStyles"), kt = bt, Et = /* @__PURE__ */ d((t) => {
109
+ const a = [...t.values()].reduce((s, p) => s + p, 0), f = [...t.entries()].map(([s, p]) => ({ label: s, value: p })).filter((s) => s.value / a * 100 >= 1);
110
+ return mt().value((s) => s.value).sort(null)(f);
111
+ }, "createPieArcs"), Mt = /* @__PURE__ */ d((t, a, f, y) => {
112
+ W.debug(`rendering pie chart
113
+ ` + t);
114
+ const s = y.db, p = rt(), o = it(s.getConfig(), p.pie), e = 40, r = 18, l = 4, g = 450, h = g, v = st(a), c = v.append("g");
115
+ c.attr("transform", "translate(" + h / 2 + "," + g / 2 + ")");
116
+ const { themeVariables: i } = p;
117
+ let [x] = ot(i.pieOuterStrokeWidth);
118
+ x ??= 2;
119
+ const w = o.textPosition, m = Math.min(h, g) / 2 - e, D = P().innerRadius(0).outerRadius(m), $ = P().innerRadius(m * w).outerRadius(m * w);
120
+ c.append("circle").attr("cx", 0).attr("cy", 0).attr("r", m + x / 2).attr("class", "pieOuterCircle");
121
+ const u = s.getSections(), A = Et(u), C = [
122
+ i.pie1,
123
+ i.pie2,
124
+ i.pie3,
125
+ i.pie4,
126
+ i.pie5,
127
+ i.pie6,
128
+ i.pie7,
129
+ i.pie8,
130
+ i.pie9,
131
+ i.pie10,
132
+ i.pie11,
133
+ i.pie12
134
+ ];
135
+ let b = 0;
136
+ u.forEach((n) => {
137
+ b += n;
138
+ });
139
+ const L = A.filter((n) => (n.data.value / b * 100).toFixed(0) !== "0"), k = gt(C).domain([
140
+ ...u.keys()
141
+ ]);
142
+ c.selectAll("mySlices").data(L).enter().append("path").attr("d", D).attr("fill", (n) => k(n.data.label)).attr("class", "pieCircle"), c.selectAll("mySlices").data(L).enter().append("text").text((n) => (n.data.value / b * 100).toFixed(0) + "%").attr("transform", (n) => "translate(" + $.centroid(n) + ")").style("text-anchor", "middle").attr("class", "slice");
143
+ const V = c.append("text").text(s.getDiagramTitle()).attr("x", 0).attr("y", -400 / 2).attr("class", "pieTitleText"), G = [...u.entries()].map(([n, M]) => ({
144
+ label: n,
145
+ value: M
146
+ })), E = c.selectAll(".legend").data(G).enter().append("g").attr("class", "legend").attr("transform", (n, M) => {
147
+ const O = r + l, Q = O * G.length / 2, X = 12 * r, Z = M * O - Q;
148
+ return "translate(" + X + "," + Z + ")";
149
+ });
150
+ E.append("rect").attr("width", r).attr("height", r).style("fill", (n) => k(n.label)).style("stroke", (n) => k(n.label)), E.append("text").attr("x", r + l).attr("y", r - l).text((n) => s.getShowData() ? `${n.label} [${n.value}]` : n.label);
151
+ const U = Math.max(
152
+ ...E.selectAll("text").nodes().map((n) => n?.getBoundingClientRect().width ?? 0)
153
+ ), j = h + e + r + l + U, N = V.node()?.getBoundingClientRect().width ?? 0, q = h / 2 - N / 2, H = h / 2 + N / 2, B = Math.min(0, q), I = Math.max(j, H) - B;
154
+ v.attr("viewBox", `${B} 0 ${I} ${g}`), lt(v, g, I, o.useMaxWidth);
155
+ }, "draw"), Rt = { draw: Mt }, Bt = {
156
+ parser: Tt,
157
+ db: _,
158
+ renderer: Rt,
159
+ styles: kt
160
+ };
161
+ export {
162
+ Bt as diagram
163
+ };