@datawhale/prosemirror-render 0.0.11 → 0.0.12

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 (45) hide show
  1. package/dist/{AttachmentBlock-D09C_Xeo.cjs → AttachmentBlock-BXCk0hjn.cjs} +1 -1
  2. package/dist/{AttachmentBlock-B-CPjKP3.js → AttachmentBlock-CPpG2dPv.js} +2 -2
  3. package/dist/{AttachmentInline-CJDSD0LJ.cjs → AttachmentInline-Bmi7A-PO.cjs} +1 -1
  4. package/dist/{AttachmentInline-CiFkwiIA.js → AttachmentInline-DeqcVAAu.js} +2 -2
  5. package/dist/{AttachmentMenu-r8CfAUvn.js → AttachmentMenu-BlYR8886.js} +1 -1
  6. package/dist/{AttachmentMenu-977dJXFy.cjs → AttachmentMenu-CqB_XZH_.cjs} +1 -1
  7. package/dist/{Callout-CSjUzN_N.js → Callout-A58rxjcd.js} +1 -1
  8. package/dist/{Callout-NbHZJyDc.cjs → Callout-D4hGVBL_.cjs} +1 -1
  9. package/dist/{CellOutput-bg5dZJRU.cjs → CellOutput-CgpD9ZVf.cjs} +1 -1
  10. package/dist/{CellOutput-DCwREnyw.js → CellOutput-DDtmytFi.js} +1 -1
  11. package/dist/{CodeBlock-CyZsJI3V.cjs → CodeBlock-DYTo0bg9.cjs} +1 -1
  12. package/dist/{CodeBlock-C5h9qR7-.js → CodeBlock-DzHugjpL.js} +1 -1
  13. package/dist/{FoldBlock-BPPYFA3-.js → FoldBlock-CJ3VZP86.js} +1 -1
  14. package/dist/{FoldBlock-Bcs5JiHU.cjs → FoldBlock-DuHOT0cm.cjs} +1 -1
  15. package/dist/{Grid-xaKYzAXE.js → Grid-CQMBfo8m.js} +1 -1
  16. package/dist/{Grid-CcORFpD_.cjs → Grid-wjd8RU78.cjs} +1 -1
  17. package/dist/{IFrame-BSaC6Crx.cjs → IFrame-CuNyVByE.cjs} +1 -1
  18. package/dist/{IFrame-Bm7hVTn1.js → IFrame-thNWtKGt.js} +1 -1
  19. package/dist/{Image-FdeYb5BV.js → Image-BpCN7g0S.js} +1 -1
  20. package/dist/{Image-BWbQijjz.cjs → Image-D6kgI-oO.cjs} +1 -1
  21. package/dist/{MathDisplay-DaHoPzzZ.js → MathDisplay-BXmKwa-7.js} +1 -1
  22. package/dist/{MathDisplay-DFJMKfYF.cjs → MathDisplay-Bk51oHnp.cjs} +1 -1
  23. package/dist/{MathInline-0Air3WEh.js → MathInline-BT1QFQpO.js} +1 -1
  24. package/dist/{MathInline-BYYosI9r.cjs → MathInline-rUQCNe0b.cjs} +1 -1
  25. package/dist/{McChoices-CDitPkx-.js → McChoices-CXvkhpsm.js} +1 -1
  26. package/dist/{McChoices-DRLOXT0T.cjs → McChoices-D8svqhmT.cjs} +1 -1
  27. package/dist/{McQuestion-BvXVduhC.js → McQuestion-BPDceSgZ.js} +1 -1
  28. package/dist/{McQuestion-DUNAdIm_.cjs → McQuestion-uwFwxlQo.cjs} +1 -1
  29. package/dist/{McSolution-Dl9FFT_T.js → McSolution-BveHl5G0.js} +1 -1
  30. package/dist/{McSolution-BXbQ_FWi.cjs → McSolution-DB6fl73p.cjs} +1 -1
  31. package/dist/{MultipleChoice-Fp1_IXwl.js → MultipleChoice-DNKuX9FK.js} +4 -4
  32. package/dist/{MultipleChoice-6A5OOg1-.cjs → MultipleChoice-DgTOWVtn.cjs} +1 -1
  33. package/dist/{Paragraph-CzTt-rpI.cjs → Paragraph-BsBVTwg-.cjs} +1 -1
  34. package/dist/{Paragraph-f_Rthafy.js → Paragraph-NxCCIiIf.js} +1 -1
  35. package/dist/{SlotNode-qzG5ZNOp.js → SlotNode-DiKoiDD2.js} +1 -1
  36. package/dist/{SlotNode-CuocYkZX.cjs → SlotNode-QH4h4XFh.cjs} +1 -1
  37. package/dist/{Text-u692xIqa.cjs → Text-Buwy2OVC.cjs} +1 -1
  38. package/dist/{Text-DJus401M.js → Text-D1jF9H18.js} +1 -1
  39. package/dist/index-ByaYOIDK.cjs +1 -0
  40. package/dist/index-D5y1u4eT.js +186 -0
  41. package/dist/index.cjs.js +1 -1
  42. package/dist/index.es.js +1 -1
  43. package/package.json +1 -1
  44. package/dist/index-D1CitI3Z.cjs +0 -1
  45. package/dist/index-Lb864EoT.js +0 -182
@@ -0,0 +1,186 @@
1
+ import { ref as y, createElementBlock as l, openBlock as a, defineAsyncComponent as k, defineComponent as f, computed as _, resolveComponent as b, createBlock as s, Suspense as v, withCtx as p, resolveDynamicComponent as C, unref as M, mergeProps as B, createCommentVNode as h, Fragment as x, renderList as L, useId as I, provide as d, watch as w } from "vue";
2
+ const R = /* @__PURE__ */ Symbol(), u = y([]), A = /* @__PURE__ */ Symbol(), S = (t) => {
3
+ if (!t)
4
+ return [];
5
+ const o = [], n = (r) => {
6
+ r.type === "image" && o.push(r), r.content && r.content.forEach((c) => n(c));
7
+ };
8
+ return n(t), o;
9
+ }, g = (t, o) => {
10
+ const n = t.__vccOpts || t;
11
+ for (const [r, c] of o)
12
+ n[r] = c;
13
+ return n;
14
+ }, $ = {}, E = { class: "error-wrapper" };
15
+ function H(t, o) {
16
+ return a(), l("div", E, "组件加载失败");
17
+ }
18
+ const N = /* @__PURE__ */ g($, [["render", H], ["__scopeId", "data-v-4fa940a8"]]), T = {};
19
+ function D(t, o) {
20
+ return "loading...";
21
+ }
22
+ const O = /* @__PURE__ */ g(T, [["render", D]]), e = (t, o = {
23
+ loadingComponent: O,
24
+ delay: 200,
25
+ errorComponent: N,
26
+ timeout: 5e3
27
+ }) => k({
28
+ loader: t,
29
+ ...o
30
+ });
31
+ function te(t) {
32
+ if (!t || !t.content)
33
+ return [t];
34
+ const o = [];
35
+ let n = [], r = null;
36
+ return t.content.forEach((c) => {
37
+ if (c.type === "heading" || c.type === "heading") {
38
+ const i = c.attrs?.level;
39
+ r === null && (r = i), i === r && n.length > 0 && (o.push({
40
+ type: "doc",
41
+ content: n
42
+ }), n = []);
43
+ }
44
+ n.push(c);
45
+ }), n.length > 0 && o.push({
46
+ type: "doc",
47
+ content: n
48
+ }), o;
49
+ }
50
+ const q = {
51
+ "attachment-inline": e(() => import("./AttachmentInline-DeqcVAAu.js")),
52
+ "attachment-block": e(() => import("./AttachmentBlock-CPpG2dPv.js"))
53
+ }, K = {
54
+ text: e(() => import("./Text-D1jF9H18.js")),
55
+ paragraph: e(() => import("./Paragraph-NxCCIiIf.js")),
56
+ heading: e(() => import("./Heading-BElRvhGn.js")),
57
+ orderedList: e(() => import("./OrderedList-B8v1gchv.js")),
58
+ bulletList: e(() => import("./BulletList-BQTUD69X.js")),
59
+ listItem: e(() => import("./ListItem-X0T7a_z8.js")),
60
+ horizontalRule: e(() => import("./HorizontalRule-BRG45oT0.js")),
61
+ blockquote: e(() => import("./Blockquote-BamWUQND.js")),
62
+ hardBreak: e(() => import("./HardBreak-B2tFO31P.js"))
63
+ }, P = {
64
+ callout: e(() => import("./Callout-A58rxjcd.js"))
65
+ }, z = {
66
+ codeBlock: e(() => import("./CodeBlock-DzHugjpL.js")),
67
+ cellOutput: e(() => import("./CellOutput-DDtmytFi.js"))
68
+ }, F = {
69
+ foldBlock: e(() => import("./FoldBlock-CJ3VZP86.js"))
70
+ }, Q = {
71
+ grid: e(() => import("./Grid-CQMBfo8m.js"))
72
+ }, V = {
73
+ iframe: e(() => import("./IFrame-thNWtKGt.js"))
74
+ }, j = {
75
+ image: e(() => import("./Image-BpCN7g0S.js"))
76
+ }, G = {
77
+ math_inline: e(() => import("./MathInline-BT1QFQpO.js")),
78
+ math_display: e(() => import("./MathDisplay-BXmKwa-7.js"))
79
+ }, J = {
80
+ multipleChoice: e(() => import("./MultipleChoice-DNKuX9FK.js")),
81
+ mcQuestion: e(() => import("./McQuestion-BPDceSgZ.js")),
82
+ mcChoices: e(() => import("./McChoices-CXvkhpsm.js")),
83
+ mcSolution: e(() => import("./McSolution-BveHl5G0.js"))
84
+ }, U = {
85
+ table: e(() => import("./TableContainer-C9PhNGlz.js")),
86
+ tableHeader: e(() => import("./TableHeader-C7KKz3e1.js")),
87
+ tableRow: e(() => import("./TableRow-OzpVq1qW.js")),
88
+ tableCell: e(() => import("./TableCell-Bp52L368.js"))
89
+ }, W = {
90
+ doc: e(() => import("./Doc-6s4VMDsx.js")),
91
+ slotNode: e(() => import("./SlotNode-DiKoiDD2.js"))
92
+ }, X = {
93
+ ...q,
94
+ // 附件和视频类型
95
+ ...K,
96
+ // 基础类型,包括各种字体样式
97
+ ...P,
98
+ // 高亮块
99
+ ...z,
100
+ // 代码块
101
+ ...F,
102
+ // 折叠块
103
+ ...Q,
104
+ // 分栏
105
+ ...j,
106
+ // 图片
107
+ ...G,
108
+ // 数学公式
109
+ ...J,
110
+ //选择题
111
+ ...U,
112
+ // 表格
113
+ ...W,
114
+ // 容器
115
+ ...V
116
+ // iframe
117
+ }, Y = /* @__PURE__ */ f({
118
+ __name: "TreeRecursive",
119
+ props: {
120
+ node: {}
121
+ },
122
+ setup(t) {
123
+ const o = /* @__PURE__ */ new Set([
124
+ "blockquote",
125
+ "orderedList",
126
+ "bulletList",
127
+ "paragraph",
128
+ "math_display",
129
+ "codeBlock",
130
+ "cellOutput",
131
+ "callout",
132
+ "foldBlock",
133
+ "image",
134
+ "attachment-block",
135
+ "grid",
136
+ "table",
137
+ "iframe",
138
+ "multipleChoice"
139
+ ]), n = _(() => o.has(t.node.type) && t.node.attrs && t.node.attrs["block-id"] ? { "data-block-id": t.node.attrs["block-id"] } : {});
140
+ return (r, c) => {
141
+ const m = b("TreeRecursive", !0);
142
+ return a(), s(v, null, {
143
+ default: p(() => [
144
+ (a(), s(C(M(X)[t.node.type]), B({ node: t.node }, n.value), {
145
+ default: p(() => [
146
+ t.node.content && !(t.node.type in ["foldBlock", "grid", "callout"]) ? (a(!0), l(x, { key: 0 }, L(t.node.content, (i) => (a(), s(m, {
147
+ node: i,
148
+ key: I()
149
+ }, null, 8, ["node"]))), 128)) : h("", !0)
150
+ ]),
151
+ _: 1
152
+ }, 16, ["node"]))
153
+ ]),
154
+ _: 1
155
+ });
156
+ };
157
+ }
158
+ }), Z = { class: "tree-render" }, oe = /* @__PURE__ */ f({
159
+ __name: "TreeRender",
160
+ props: {
161
+ node: {},
162
+ axios: {}
163
+ },
164
+ setup(t) {
165
+ return d(A, u), d(R, t.axios), w(
166
+ () => t.node,
167
+ (o) => {
168
+ u.value = S(o);
169
+ },
170
+ { immediate: !0 }
171
+ ), (o, n) => (a(), l("div", Z, [
172
+ t.node ? (a(), s(Y, {
173
+ key: 0,
174
+ node: t.node
175
+ }, null, 8, ["node"])) : h("", !0)
176
+ ]));
177
+ }
178
+ });
179
+ export {
180
+ g as _,
181
+ R as a,
182
+ Y as b,
183
+ oe as c,
184
+ A as i,
185
+ te as s
186
+ };
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-D1CitI3Z.cjs");exports.TreeRender=e._sfc_main$1;exports.splitDocIntoMultiPagesByHeading=e.splitDocIntoMultiPagesByHeading;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-ByaYOIDK.cjs");exports.TreeRender=e._sfc_main$1;exports.splitDocIntoMultiPagesByHeading=e.splitDocIntoMultiPagesByHeading;
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { c as a, s as o } from "./index-Lb864EoT.js";
1
+ import { c as a, s as o } from "./index-D5y1u4eT.js";
2
2
  export {
3
3
  a as TreeRender,
4
4
  o as splitDocIntoMultiPagesByHeading
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datawhale/prosemirror-render",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.es.js",
@@ -1 +0,0 @@
1
- "use strict";const e=require("vue"),a=Symbol(),l=e.ref([]),u=Symbol(),p=r=>{if(!r)return[];const t=[],n=s=>{s.type==="image"&&t.push(s),s.content&&s.content.forEach(i=>n(i))};return n(r),t},c=(r,t)=>{const n=r.__vccOpts||r;for(const[s,i]of t)n[s]=i;return n},v={},f={class:"error-wrapper"};function k(r,t){return e.openBlock(),e.createElementBlock("div",f,"组件加载失败")}const q=c(v,[["render",k],["__scopeId","data-v-4fa940a8"]]),P={};function g(r,t){return"loading..."}const y=c(P,[["render",g]]),o=(r,t={loadingComponent:y,delay:200,errorComponent:q,timeout:5e3})=>e.defineAsyncComponent({loader:r,...t});function B(r){if(!r||!r.content||!Array.isArray(r.content))return[r];const t=[];let n=[];return r.content.forEach(s=>{s.type==="heading"?(n.length>0&&t.push({type:"doc",content:n}),n=[s]):n.push(s)}),n.length>0&&t.push({type:"doc",content:n}),t}const _={"attachment-inline":o(()=>Promise.resolve().then(()=>require("./AttachmentInline-CJDSD0LJ.cjs"))),"attachment-block":o(()=>Promise.resolve().then(()=>require("./AttachmentBlock-D09C_Xeo.cjs")))},C={text:o(()=>Promise.resolve().then(()=>require("./Text-u692xIqa.cjs"))),paragraph:o(()=>Promise.resolve().then(()=>require("./Paragraph-CzTt-rpI.cjs"))),heading:o(()=>Promise.resolve().then(()=>require("./Heading-BUnffIAz.cjs"))),orderedList:o(()=>Promise.resolve().then(()=>require("./OrderedList-DMl3tvwP.cjs"))),bulletList:o(()=>Promise.resolve().then(()=>require("./BulletList-CFjF3U-l.cjs"))),listItem:o(()=>Promise.resolve().then(()=>require("./ListItem-BrjxeGxz.cjs"))),horizontalRule:o(()=>Promise.resolve().then(()=>require("./HorizontalRule-CE09LZGf.cjs"))),blockquote:o(()=>Promise.resolve().then(()=>require("./Blockquote-CQSBFnsu.cjs"))),hardBreak:o(()=>Promise.resolve().then(()=>require("./HardBreak-Dbf5Zg5o.cjs")))},b={callout:o(()=>Promise.resolve().then(()=>require("./Callout-NbHZJyDc.cjs")))},M={codeBlock:o(()=>Promise.resolve().then(()=>require("./CodeBlock-CyZsJI3V.cjs"))),cellOutput:o(()=>Promise.resolve().then(()=>require("./CellOutput-bg5dZJRU.cjs")))},x={foldBlock:o(()=>Promise.resolve().then(()=>require("./FoldBlock-Bcs5JiHU.cjs")))},I={grid:o(()=>Promise.resolve().then(()=>require("./Grid-CcORFpD_.cjs")))},w={iframe:o(()=>Promise.resolve().then(()=>require("./IFrame-BSaC6Crx.cjs")))},A={image:o(()=>Promise.resolve().then(()=>require("./Image-BWbQijjz.cjs")))},E={math_inline:o(()=>Promise.resolve().then(()=>require("./MathInline-BYYosI9r.cjs"))),math_display:o(()=>Promise.resolve().then(()=>require("./MathDisplay-DFJMKfYF.cjs")))},L={multipleChoice:o(()=>Promise.resolve().then(()=>require("./MultipleChoice-6A5OOg1-.cjs"))),mcQuestion:o(()=>Promise.resolve().then(()=>require("./McQuestion-DUNAdIm_.cjs"))),mcChoices:o(()=>Promise.resolve().then(()=>require("./McChoices-DRLOXT0T.cjs"))),mcSolution:o(()=>Promise.resolve().then(()=>require("./McSolution-BXbQ_FWi.cjs")))},N={table:o(()=>Promise.resolve().then(()=>require("./TableContainer-C5KXY6f7.cjs"))),tableHeader:o(()=>Promise.resolve().then(()=>require("./TableHeader-BTuqvorM.cjs"))),tableRow:o(()=>Promise.resolve().then(()=>require("./TableRow-D4F6AKFt.cjs"))),tableCell:o(()=>Promise.resolve().then(()=>require("./TableCell-BY9gdldc.cjs")))},R={doc:o(()=>Promise.resolve().then(()=>require("./Doc-D2yvlSII.cjs"))),slotNode:o(()=>Promise.resolve().then(()=>require("./SlotNode-CuocYkZX.cjs")))},$={..._,...C,...b,...M,...x,...I,...A,...E,...L,...N,...R,...w},m=e.defineComponent({__name:"TreeRecursive",props:{node:{}},setup(r){const t=new Set(["blockquote","orderedList","bulletList","paragraph","math_display","codeBlock","cellOutput","callout","foldBlock","image","attachment-block","grid","table","iframe","multipleChoice"]),n=e.computed(()=>t.has(r.node.type)&&r.node.attrs&&r.node.attrs["block-id"]?{"data-block-id":r.node.attrs["block-id"]}:{});return(s,i)=>{const d=e.resolveComponent("TreeRecursive",!0);return e.openBlock(),e.createBlock(e.Suspense,null,{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref($)[r.node.type]),e.mergeProps({node:r.node},n.value),{default:e.withCtx(()=>[r.node.content&&!(r.node.type in["foldBlock","grid","callout"])?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(r.node.content,h=>(e.openBlock(),e.createBlock(d,{node:h,key:e.useId()},null,8,["node"]))),128)):e.createCommentVNode("",!0)]),_:1},16,["node"]))]),_:1})}}}),S={class:"tree-render"},D=e.defineComponent({__name:"TreeRender",props:{node:{},axios:{}},setup(r){return e.provide(u,l),e.provide(a,r.axios),e.watch(()=>r.node,t=>{l.value=p(t)},{immediate:!0}),(t,n)=>(e.openBlock(),e.createElementBlock("div",S,[r.node?(e.openBlock(),e.createBlock(m,{key:0,node:r.node},null,8,["node"])):e.createCommentVNode("",!0)]))}});exports._export_sfc=c;exports._sfc_main=m;exports._sfc_main$1=D;exports.axiosKey=a;exports.imageNodesKey=u;exports.splitDocIntoMultiPagesByHeading=B;
@@ -1,182 +0,0 @@
1
- import { ref as y, createElementBlock as s, openBlock as c, defineAsyncComponent as k, defineComponent as d, computed as _, resolveComponent as b, createBlock as i, Suspense as C, withCtx as l, resolveDynamicComponent as v, unref as M, mergeProps as B, createCommentVNode as u, Fragment as x, renderList as A, useId as I, provide as m, watch as w } from "vue";
2
- const L = /* @__PURE__ */ Symbol(), p = y([]), R = /* @__PURE__ */ Symbol(), S = (e) => {
3
- if (!e)
4
- return [];
5
- const o = [], n = (r) => {
6
- r.type === "image" && o.push(r), r.content && r.content.forEach((a) => n(a));
7
- };
8
- return n(e), o;
9
- }, f = (e, o) => {
10
- const n = e.__vccOpts || e;
11
- for (const [r, a] of o)
12
- n[r] = a;
13
- return n;
14
- }, $ = {}, E = { class: "error-wrapper" };
15
- function N(e, o) {
16
- return c(), s("div", E, "组件加载失败");
17
- }
18
- const T = /* @__PURE__ */ f($, [["render", N], ["__scopeId", "data-v-4fa940a8"]]), D = {};
19
- function O(e, o) {
20
- return "loading...";
21
- }
22
- const q = /* @__PURE__ */ f(D, [["render", O]]), t = (e, o = {
23
- loadingComponent: q,
24
- delay: 200,
25
- errorComponent: T,
26
- timeout: 5e3
27
- }) => k({
28
- loader: e,
29
- ...o
30
- });
31
- function te(e) {
32
- if (!e || !e.content || !Array.isArray(e.content))
33
- return [e];
34
- const o = [];
35
- let n = [];
36
- return e.content.forEach((r) => {
37
- r.type === "heading" ? (n.length > 0 && o.push({
38
- type: "doc",
39
- content: n
40
- }), n = [r]) : n.push(r);
41
- }), n.length > 0 && o.push({
42
- type: "doc",
43
- content: n
44
- }), o;
45
- }
46
- const H = {
47
- "attachment-inline": t(() => import("./AttachmentInline-CiFkwiIA.js")),
48
- "attachment-block": t(() => import("./AttachmentBlock-B-CPjKP3.js"))
49
- }, K = {
50
- text: t(() => import("./Text-DJus401M.js")),
51
- paragraph: t(() => import("./Paragraph-f_Rthafy.js")),
52
- heading: t(() => import("./Heading-BElRvhGn.js")),
53
- orderedList: t(() => import("./OrderedList-B8v1gchv.js")),
54
- bulletList: t(() => import("./BulletList-BQTUD69X.js")),
55
- listItem: t(() => import("./ListItem-X0T7a_z8.js")),
56
- horizontalRule: t(() => import("./HorizontalRule-BRG45oT0.js")),
57
- blockquote: t(() => import("./Blockquote-BamWUQND.js")),
58
- hardBreak: t(() => import("./HardBreak-B2tFO31P.js"))
59
- }, P = {
60
- callout: t(() => import("./Callout-CSjUzN_N.js"))
61
- }, z = {
62
- codeBlock: t(() => import("./CodeBlock-C5h9qR7-.js")),
63
- cellOutput: t(() => import("./CellOutput-DCwREnyw.js"))
64
- }, F = {
65
- foldBlock: t(() => import("./FoldBlock-BPPYFA3-.js"))
66
- }, Q = {
67
- grid: t(() => import("./Grid-xaKYzAXE.js"))
68
- }, V = {
69
- iframe: t(() => import("./IFrame-Bm7hVTn1.js"))
70
- }, j = {
71
- image: t(() => import("./Image-FdeYb5BV.js"))
72
- }, G = {
73
- math_inline: t(() => import("./MathInline-0Air3WEh.js")),
74
- math_display: t(() => import("./MathDisplay-DaHoPzzZ.js"))
75
- }, J = {
76
- multipleChoice: t(() => import("./MultipleChoice-Fp1_IXwl.js")),
77
- mcQuestion: t(() => import("./McQuestion-BvXVduhC.js")),
78
- mcChoices: t(() => import("./McChoices-CDitPkx-.js")),
79
- mcSolution: t(() => import("./McSolution-Dl9FFT_T.js"))
80
- }, U = {
81
- table: t(() => import("./TableContainer-C9PhNGlz.js")),
82
- tableHeader: t(() => import("./TableHeader-C7KKz3e1.js")),
83
- tableRow: t(() => import("./TableRow-OzpVq1qW.js")),
84
- tableCell: t(() => import("./TableCell-Bp52L368.js"))
85
- }, W = {
86
- doc: t(() => import("./Doc-6s4VMDsx.js")),
87
- slotNode: t(() => import("./SlotNode-qzG5ZNOp.js"))
88
- }, X = {
89
- ...H,
90
- // 附件和视频类型
91
- ...K,
92
- // 基础类型,包括各种字体样式
93
- ...P,
94
- // 高亮块
95
- ...z,
96
- // 代码块
97
- ...F,
98
- // 折叠块
99
- ...Q,
100
- // 分栏
101
- ...j,
102
- // 图片
103
- ...G,
104
- // 数学公式
105
- ...J,
106
- //选择题
107
- ...U,
108
- // 表格
109
- ...W,
110
- // 容器
111
- ...V
112
- // iframe
113
- }, Y = /* @__PURE__ */ d({
114
- __name: "TreeRecursive",
115
- props: {
116
- node: {}
117
- },
118
- setup(e) {
119
- const o = /* @__PURE__ */ new Set([
120
- "blockquote",
121
- "orderedList",
122
- "bulletList",
123
- "paragraph",
124
- "math_display",
125
- "codeBlock",
126
- "cellOutput",
127
- "callout",
128
- "foldBlock",
129
- "image",
130
- "attachment-block",
131
- "grid",
132
- "table",
133
- "iframe",
134
- "multipleChoice"
135
- ]), n = _(() => o.has(e.node.type) && e.node.attrs && e.node.attrs["block-id"] ? { "data-block-id": e.node.attrs["block-id"] } : {});
136
- return (r, a) => {
137
- const h = b("TreeRecursive", !0);
138
- return c(), i(C, null, {
139
- default: l(() => [
140
- (c(), i(v(M(X)[e.node.type]), B({ node: e.node }, n.value), {
141
- default: l(() => [
142
- e.node.content && !(e.node.type in ["foldBlock", "grid", "callout"]) ? (c(!0), s(x, { key: 0 }, A(e.node.content, (g) => (c(), i(h, {
143
- node: g,
144
- key: I()
145
- }, null, 8, ["node"]))), 128)) : u("", !0)
146
- ]),
147
- _: 1
148
- }, 16, ["node"]))
149
- ]),
150
- _: 1
151
- });
152
- };
153
- }
154
- }), Z = { class: "tree-render" }, oe = /* @__PURE__ */ d({
155
- __name: "TreeRender",
156
- props: {
157
- node: {},
158
- axios: {}
159
- },
160
- setup(e) {
161
- return m(R, p), m(L, e.axios), w(
162
- () => e.node,
163
- (o) => {
164
- p.value = S(o);
165
- },
166
- { immediate: !0 }
167
- ), (o, n) => (c(), s("div", Z, [
168
- e.node ? (c(), i(Y, {
169
- key: 0,
170
- node: e.node
171
- }, null, 8, ["node"])) : u("", !0)
172
- ]));
173
- }
174
- });
175
- export {
176
- f as _,
177
- L as a,
178
- Y as b,
179
- oe as c,
180
- R as i,
181
- te as s
182
- };