@datawhale/prosemirror-render 0.0.9 → 0.0.11

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