@datawhale/prosemirror-render 0.0.8 → 0.0.10

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 (46) hide show
  1. package/dist/{AttachmentBlock-CTvDbAcS.js → AttachmentBlock-CV4bIQNR.js} +2 -2
  2. package/dist/{AttachmentBlock-P1jG1cGY.cjs → AttachmentBlock-u8HLmuS1.cjs} +1 -1
  3. package/dist/{AttachmentInline-Cr4Zec57.cjs → AttachmentInline-CiXvLJgR.cjs} +1 -1
  4. package/dist/{AttachmentInline-B7Cj5QJ0.js → AttachmentInline-DGSYiwrS.js} +2 -2
  5. package/dist/{AttachmentMenu-ChIj7hE3.cjs → AttachmentMenu-5CeR8pic.cjs} +1 -1
  6. package/dist/{AttachmentMenu-CM2tOV0z.js → AttachmentMenu-DuCu2jWV.js} +1 -1
  7. package/dist/{Callout-DazLxdGD.cjs → Callout-DdgZnqvM.cjs} +1 -1
  8. package/dist/{Callout-Def3dYjo.js → Callout-tf3Yg9S0.js} +1 -1
  9. package/dist/{CellOutput-B26_5ev3.cjs → CellOutput-ByX6jmZM.cjs} +1 -1
  10. package/dist/{CellOutput-Dbg8ZL0H.js → CellOutput-CMALyDYd.js} +1 -1
  11. package/dist/{CodeBlock-D8In7xR8.cjs → CodeBlock--7qFlRWP.cjs} +1 -1
  12. package/dist/{CodeBlock-BsqBkTD3.js → CodeBlock-DbEjF_Kw.js} +1 -1
  13. package/dist/{FoldBlock-B_C9Qoy9.js → FoldBlock-BCk2e21I.js} +1 -1
  14. package/dist/{FoldBlock-BuwPwAaK.cjs → FoldBlock-BQg9IBMS.cjs} +1 -1
  15. package/dist/{Grid-B79na0-H.js → Grid-Bovh5nmY.js} +1 -1
  16. package/dist/{Grid-DvLYfpeG.cjs → Grid-D1kpeK1V.cjs} +1 -1
  17. package/dist/{IFrame-ChfURc_t.cjs → IFrame-D75ApJe8.cjs} +1 -1
  18. package/dist/{IFrame-BXfWlAkB.js → IFrame-DXfrrRuk.js} +1 -1
  19. package/dist/{Image-RwlDCWBT.js → Image--yswo9C1.js} +1 -1
  20. package/dist/{Image-BAy3DLIi.cjs → Image-CGZEmHYK.cjs} +1 -1
  21. package/dist/{MathDisplay-fiHorxPn.js → MathDisplay-BvE50YWq.js} +1 -1
  22. package/dist/{MathDisplay-C0esLx5a.cjs → MathDisplay-CzQ0qRuW.cjs} +1 -1
  23. package/dist/{MathInline-gFzVPQ0D.js → MathInline-G9q6yivs.js} +1 -1
  24. package/dist/{MathInline-CnkNthuZ.cjs → MathInline-QqoFc5JE.cjs} +1 -1
  25. package/dist/{McChoices-DDKPec4G.js → McChoices-1azqAf-m.js} +1 -1
  26. package/dist/{McChoices-BDsJqV2C.cjs → McChoices-CfywiCEs.cjs} +1 -1
  27. package/dist/{McQuestion-CChLZMYt.cjs → McQuestion-Ba3qJ-FL.cjs} +1 -1
  28. package/dist/{McQuestion-1efXXh4O.js → McQuestion-CnCOlxBk.js} +1 -1
  29. package/dist/{McSolution-5feP69N7.cjs → McSolution-BOHaq8_k.cjs} +1 -1
  30. package/dist/{McSolution-XXRJWaYt.js → McSolution-DDA7Qhyl.js} +1 -1
  31. package/dist/{MultipleChoice-DT_c5R8o.js → MultipleChoice-DhJ3_sA0.js} +4 -4
  32. package/dist/{MultipleChoice-CQ9cbLUg.cjs → MultipleChoice-v1ID9wsB.cjs} +1 -1
  33. package/dist/{Paragraph-CWn5tuOy.js → Paragraph-C3vQjERf.js} +1 -1
  34. package/dist/{Paragraph-nAepKpbl.cjs → Paragraph-Cbwrf0Ax.cjs} +1 -1
  35. package/dist/{SlotNode-BhXyQCzg.js → SlotNode-Cj9OQ-yJ.js} +1 -1
  36. package/dist/{SlotNode-DqwL4TkF.cjs → SlotNode-D5z9YYAl.cjs} +1 -1
  37. package/dist/{Text-Nb_IXPkh.js → Text-Bcy8ncuu.js} +1 -1
  38. package/dist/{Text-CS6RYM2H.cjs → Text-Df2yJUWR.cjs} +1 -1
  39. package/dist/{index-CTcnNF6r.js → index-DO0f6PZF.js} +70 -51
  40. package/dist/index-emRMM6uw.cjs +1 -0
  41. package/dist/index.cjs.js +1 -1
  42. package/dist/index.es.js +3 -2
  43. package/dist/types/components/index.d.ts +0 -1
  44. package/dist/types/index.d.ts +2 -1
  45. package/package.json +1 -1
  46. package/dist/index-kIuhy4WL.cjs +0 -1
@@ -1,5 +1,7 @@
1
- import { ref as g, createElementBlock as s, openBlock as c, defineAsyncComponent as k, defineComponent as d, computed as _, resolveComponent as b, createBlock as i, Suspense as y, withCtx as m, resolveDynamicComponent as C, unref as v, mergeProps as M, createCommentVNode as B, Fragment as x, renderList as w, useId as I, provide as l, watch as L, createVNode as R } from "vue";
2
- const A = /* @__PURE__ */ Symbol(), p = g([]), N = /* @__PURE__ */ Symbol(), S = (t) => {
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
+ if (!t)
4
+ return [];
3
5
  const o = [], n = (r) => {
4
6
  r.type === "image" && o.push(r), r.content && r.content.forEach((a) => n(a));
5
7
  };
@@ -9,28 +11,44 @@ const A = /* @__PURE__ */ Symbol(), p = g([]), N = /* @__PURE__ */ Symbol(), S =
9
11
  for (const [r, a] of o)
10
12
  n[r] = a;
11
13
  return n;
12
- }, $ = {}, T = { class: "error-wrapper" };
13
- function E(t, o) {
14
- return c(), s("div", T, "组件加载失败");
14
+ }, $ = {}, E = { class: "error-wrapper" };
15
+ function T(t, o) {
16
+ return c(), s("div", E, "组件加载失败");
15
17
  }
16
- const O = /* @__PURE__ */ u($, [["render", E], ["__scopeId", "data-v-4fa940a8"]]), q = {};
17
- function D(t, o) {
18
+ const D = /* @__PURE__ */ u($, [["render", T], ["__scopeId", "data-v-4fa940a8"]]), O = {};
19
+ function q(t, o) {
18
20
  return "loading...";
19
21
  }
20
- const K = /* @__PURE__ */ u(q, [["render", D]]), e = (t, o = {
21
- loadingComponent: K,
22
+ const H = /* @__PURE__ */ u(O, [["render", q]]), e = (t, o = {
23
+ loadingComponent: H,
22
24
  delay: 200,
23
- errorComponent: O,
25
+ errorComponent: D,
24
26
  timeout: 5e3
25
- }) => k({
27
+ }) => y({
26
28
  loader: t,
27
29
  ...o
28
- }), V = {
29
- "attachment-inline": e(() => import("./AttachmentInline-B7Cj5QJ0.js")),
30
- "attachment-block": e(() => import("./AttachmentBlock-CTvDbAcS.js"))
31
- }, z = {
32
- text: e(() => import("./Text-Nb_IXPkh.js")),
33
- paragraph: e(() => import("./Paragraph-CWn5tuOy.js")),
30
+ });
31
+ function oe(t) {
32
+ if (!t || !t.content || !Array.isArray(t.content))
33
+ return [t];
34
+ const o = [];
35
+ let n = [];
36
+ return t.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 K = {
47
+ "attachment-inline": e(() => import("./AttachmentInline-DGSYiwrS.js")),
48
+ "attachment-block": e(() => import("./AttachmentBlock-CV4bIQNR.js"))
49
+ }, P = {
50
+ text: e(() => import("./Text-Bcy8ncuu.js")),
51
+ paragraph: e(() => import("./Paragraph-C3vQjERf.js")),
34
52
  heading: e(() => import("./Heading-BElRvhGn.js")),
35
53
  orderedList: e(() => import("./OrderedList-B8v1gchv.js")),
36
54
  bulletList: e(() => import("./BulletList-BQTUD69X.js")),
@@ -38,27 +56,27 @@ const K = /* @__PURE__ */ u(q, [["render", D]]), e = (t, o = {
38
56
  horizontalRule: e(() => import("./HorizontalRule-BRG45oT0.js")),
39
57
  blockquote: e(() => import("./Blockquote-BamWUQND.js")),
40
58
  hardBreak: e(() => import("./HardBreak-B2tFO31P.js"))
59
+ }, V = {
60
+ callout: e(() => import("./Callout-tf3Yg9S0.js"))
61
+ }, z = {
62
+ codeBlock: e(() => import("./CodeBlock-DbEjF_Kw.js")),
63
+ cellOutput: e(() => import("./CellOutput-CMALyDYd.js"))
41
64
  }, F = {
42
- callout: e(() => import("./Callout-Def3dYjo.js"))
43
- }, H = {
44
- codeBlock: e(() => import("./CodeBlock-BsqBkTD3.js")),
45
- cellOutput: e(() => import("./CellOutput-Dbg8ZL0H.js"))
46
- }, P = {
47
- foldBlock: e(() => import("./FoldBlock-B_C9Qoy9.js"))
65
+ foldBlock: e(() => import("./FoldBlock-BCk2e21I.js"))
48
66
  }, Q = {
49
- grid: e(() => import("./Grid-B79na0-H.js"))
67
+ grid: e(() => import("./Grid-Bovh5nmY.js"))
50
68
  }, j = {
51
- iframe: e(() => import("./IFrame-BXfWlAkB.js"))
69
+ iframe: e(() => import("./IFrame-DXfrrRuk.js"))
52
70
  }, G = {
53
- image: e(() => import("./Image-RwlDCWBT.js"))
71
+ image: e(() => import("./Image--yswo9C1.js"))
54
72
  }, J = {
55
- math_inline: e(() => import("./MathInline-gFzVPQ0D.js")),
56
- math_display: e(() => import("./MathDisplay-fiHorxPn.js"))
73
+ math_inline: e(() => import("./MathInline-G9q6yivs.js")),
74
+ math_display: e(() => import("./MathDisplay-BvE50YWq.js"))
57
75
  }, U = {
58
- multipleChoice: e(() => import("./MultipleChoice-DT_c5R8o.js")),
59
- mcQuestion: e(() => import("./McQuestion-1efXXh4O.js")),
60
- mcChoices: e(() => import("./McChoices-DDKPec4G.js")),
61
- mcSolution: e(() => import("./McSolution-XXRJWaYt.js"))
76
+ multipleChoice: e(() => import("./MultipleChoice-DhJ3_sA0.js")),
77
+ mcQuestion: e(() => import("./McQuestion-CnCOlxBk.js")),
78
+ mcChoices: e(() => import("./McChoices-1azqAf-m.js")),
79
+ mcSolution: e(() => import("./McSolution-DDA7Qhyl.js"))
62
80
  }, W = {
63
81
  table: e(() => import("./TableContainer-C9PhNGlz.js")),
64
82
  tableHeader: e(() => import("./TableHeader-C7KKz3e1.js")),
@@ -66,17 +84,17 @@ const K = /* @__PURE__ */ u(q, [["render", D]]), e = (t, o = {
66
84
  tableCell: e(() => import("./TableCell-Bp52L368.js"))
67
85
  }, X = {
68
86
  doc: e(() => import("./Doc-6s4VMDsx.js")),
69
- slotNode: e(() => import("./SlotNode-BhXyQCzg.js"))
87
+ slotNode: e(() => import("./SlotNode-Cj9OQ-yJ.js"))
70
88
  }, Y = {
71
- ...V,
89
+ ...K,
72
90
  // 附件和视频类型
73
- ...z,
91
+ ...P,
74
92
  // 基础类型,包括各种字体样式
75
- ...F,
93
+ ...V,
76
94
  // 高亮块
77
- ...H,
95
+ ...z,
78
96
  // 代码块
79
- ...P,
97
+ ...F,
80
98
  // 折叠块
81
99
  ...Q,
82
100
  // 分栏
@@ -114,14 +132,14 @@ const K = /* @__PURE__ */ u(q, [["render", D]]), e = (t, o = {
114
132
  "table",
115
133
  "iframe",
116
134
  "multipleChoice"
117
- ]), n = _(() => o.has(t.node.type) && t.node.attrs && t.node.attrs["block-id"] ? { "data-block-id": t.node.attrs["block-id"] } : {});
135
+ ]), n = k(() => o.has(t.node.type) && t.node.attrs && t.node.attrs["block-id"] ? { "data-block-id": t.node.attrs["block-id"] } : {});
118
136
  return (r, a) => {
119
- const f = b("TreeRecursive", !0);
120
- return c(), i(y, null, {
121
- default: m(() => [
137
+ const f = _("TreeRecursive", !0);
138
+ return c(), i(b, null, {
139
+ default: l(() => [
122
140
  (c(), i(C(v(Y)[t.node.type]), M({ node: t.node }, n.value), {
123
- default: m(() => [
124
- t.node.content && !(t.node.type in ["foldBlock", "grid", "callout"]) ? (c(!0), s(x, { key: 0 }, w(t.node.content, (h) => (c(), i(f, {
141
+ default: l(() => [
142
+ t.node.content && !(t.node.type in ["foldBlock", "grid", "callout"]) ? (c(!0), s(x, { key: 0 }, A(t.node.content, (h) => (c(), i(f, {
125
143
  node: h,
126
144
  key: I()
127
145
  }, null, 8, ["node"]))), 128)) : B("", !0)
@@ -133,28 +151,29 @@ const K = /* @__PURE__ */ u(q, [["render", D]]), e = (t, o = {
133
151
  });
134
152
  };
135
153
  }
136
- }), ee = { class: "tree-render" }, oe = /* @__PURE__ */ d({
154
+ }), ee = { class: "tree-render" }, ne = /* @__PURE__ */ d({
137
155
  __name: "TreeRender",
138
156
  props: {
139
157
  node: {},
140
158
  axios: {}
141
159
  },
142
160
  setup(t) {
143
- return l(N, p), l(A, t.axios), L(
161
+ return p(N, m), p(R, t.axios), w(
144
162
  () => t.node,
145
163
  (o) => {
146
- p.value = S(o);
164
+ m.value = S(o);
147
165
  },
148
166
  { immediate: !0 }
149
167
  ), (o, n) => (c(), s("div", ee, [
150
- R(Z, { node: t.node }, null, 8, ["node"])
168
+ L(Z, { node: t.node }, null, 8, ["node"])
151
169
  ]));
152
170
  }
153
171
  });
154
172
  export {
155
173
  u as _,
156
- A as a,
174
+ R as a,
157
175
  Z as b,
158
- oe as c,
159
- N as i
176
+ ne as c,
177
+ N as i,
178
+ oe as s
160
179
  };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),a=Symbol(),l=e.ref([]),u=Symbol(),p=t=>{if(!t)return[];const o=[],n=s=>{s.type==="image"&&o.push(s),s.content&&s.content.forEach(i=>n(i))};return n(t),o},c=(t,o)=>{const n=t.__vccOpts||t;for(const[s,i]of o)n[s]=i;return n},v={},f={class:"error-wrapper"};function q(t,o){return e.openBlock(),e.createElementBlock("div",f,"组件加载失败")}const P=c(v,[["render",q],["__scopeId","data-v-4fa940a8"]]),k={};function g(t,o){return"loading..."}const y=c(k,[["render",g]]),r=(t,o={loadingComponent:y,delay:200,errorComponent:P,timeout:5e3})=>e.defineAsyncComponent({loader:t,...o});function _(t){if(!t||!t.content||!Array.isArray(t.content))return[t];const o=[];let n=[];return t.content.forEach(s=>{s.type==="heading"?(n.length>0&&o.push({type:"doc",content:n}),n=[s]):n.push(s)}),n.length>0&&o.push({type:"doc",content:n}),o}const B={"attachment-inline":r(()=>Promise.resolve().then(()=>require("./AttachmentInline-CiXvLJgR.cjs"))),"attachment-block":r(()=>Promise.resolve().then(()=>require("./AttachmentBlock-u8HLmuS1.cjs")))},b={text:r(()=>Promise.resolve().then(()=>require("./Text-Df2yJUWR.cjs"))),paragraph:r(()=>Promise.resolve().then(()=>require("./Paragraph-Cbwrf0Ax.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-DdgZnqvM.cjs")))},M={codeBlock:r(()=>Promise.resolve().then(()=>require("./CodeBlock--7qFlRWP.cjs"))),cellOutput:r(()=>Promise.resolve().then(()=>require("./CellOutput-ByX6jmZM.cjs")))},x={foldBlock:r(()=>Promise.resolve().then(()=>require("./FoldBlock-BQg9IBMS.cjs")))},I={grid:r(()=>Promise.resolve().then(()=>require("./Grid-D1kpeK1V.cjs")))},w={iframe:r(()=>Promise.resolve().then(()=>require("./IFrame-D75ApJe8.cjs")))},A={image:r(()=>Promise.resolve().then(()=>require("./Image-CGZEmHYK.cjs")))},E={math_inline:r(()=>Promise.resolve().then(()=>require("./MathInline-QqoFc5JE.cjs"))),math_display:r(()=>Promise.resolve().then(()=>require("./MathDisplay-CzQ0qRuW.cjs")))},L={multipleChoice:r(()=>Promise.resolve().then(()=>require("./MultipleChoice-v1ID9wsB.cjs"))),mcQuestion:r(()=>Promise.resolve().then(()=>require("./McQuestion-Ba3qJ-FL.cjs"))),mcChoices:r(()=>Promise.resolve().then(()=>require("./McChoices-CfywiCEs.cjs"))),mcSolution:r(()=>Promise.resolve().then(()=>require("./McSolution-BOHaq8_k.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-D5z9YYAl.cjs")))},$={...B,...b,...C,...M,...x,...I,...A,...E,...L,...N,...R,...w},m=e.defineComponent({__name:"TreeRecursive",props:{node:{}},setup(t){const o=new Set(["blockquote","orderedList","bulletList","paragraph","math_display","codeBlock","cellOutput","callout","foldBlock","image","attachment-block","grid","table","iframe","multipleChoice"]),n=e.computed(()=>o.has(t.node.type)&&t.node.attrs&&t.node.attrs["block-id"]?{"data-block-id":t.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($)[t.node.type]),e.mergeProps({node:t.node},n.value),{default:e.withCtx(()=>[t.node.content&&!(t.node.type in["foldBlock","grid","callout"])?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.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(t){return e.provide(u,l),e.provide(a,t.axios),e.watch(()=>t.node,o=>{l.value=p(o)},{immediate:!0}),(o,n)=>(e.openBlock(),e.createElementBlock("div",S,[e.createVNode(m,{node:t.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=_;
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-kIuhy4WL.cjs");exports.TreeRender=e._sfc_main$1;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-emRMM6uw.cjs");exports.TreeRender=e._sfc_main$1;exports.splitDocIntoMultiPagesByHeading=e.splitDocIntoMultiPagesByHeading;
package/dist/index.es.js CHANGED
@@ -1,4 +1,5 @@
1
- import { c as o } from "./index-CTcnNF6r.js";
1
+ import { c as a, s as o } from "./index-DO0f6PZF.js";
2
2
  export {
3
- o as TreeRender
3
+ a as TreeRender,
4
+ o as splitDocIntoMultiPagesByHeading
4
5
  };
@@ -1,2 +1 @@
1
1
  export { default as TreeRender } from "./TreeRender.vue";
2
- export { splitDocIntoMultiPagesByHeading } from "./collections/utils";
@@ -1,2 +1,3 @@
1
- import TreeRender from './components/TreeRender.vue';
1
+ import TreeRender from "./components/TreeRender.vue";
2
+ export { splitDocIntoMultiPagesByHeading } from "./components/collections/utils";
2
3
  export { TreeRender };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datawhale/prosemirror-render",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
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([]),m=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 k=c(v,[["render",q],["__scopeId","data-v-4fa940a8"]]),P={};function _(o,t){return"loading..."}const g=c(P,[["render",_]]),r=(o,t={loadingComponent:g,delay:200,errorComponent:k,timeout:5e3})=>e.defineAsyncComponent({loader:o,...t}),y={"attachment-inline":r(()=>Promise.resolve().then(()=>require("./AttachmentInline-Cr4Zec57.cjs"))),"attachment-block":r(()=>Promise.resolve().then(()=>require("./AttachmentBlock-P1jG1cGY.cjs")))},B={text:r(()=>Promise.resolve().then(()=>require("./Text-CS6RYM2H.cjs"))),paragraph:r(()=>Promise.resolve().then(()=>require("./Paragraph-nAepKpbl.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")))},b={callout:r(()=>Promise.resolve().then(()=>require("./Callout-DazLxdGD.cjs")))},C={codeBlock:r(()=>Promise.resolve().then(()=>require("./CodeBlock-D8In7xR8.cjs"))),cellOutput:r(()=>Promise.resolve().then(()=>require("./CellOutput-B26_5ev3.cjs")))},x={foldBlock:r(()=>Promise.resolve().then(()=>require("./FoldBlock-BuwPwAaK.cjs")))},M={grid:r(()=>Promise.resolve().then(()=>require("./Grid-DvLYfpeG.cjs")))},w={iframe:r(()=>Promise.resolve().then(()=>require("./IFrame-ChfURc_t.cjs")))},I={image:r(()=>Promise.resolve().then(()=>require("./Image-BAy3DLIi.cjs")))},L={math_inline:r(()=>Promise.resolve().then(()=>require("./MathInline-CnkNthuZ.cjs"))),math_display:r(()=>Promise.resolve().then(()=>require("./MathDisplay-C0esLx5a.cjs")))},N={multipleChoice:r(()=>Promise.resolve().then(()=>require("./MultipleChoice-CQ9cbLUg.cjs"))),mcQuestion:r(()=>Promise.resolve().then(()=>require("./McQuestion-CChLZMYt.cjs"))),mcChoices:r(()=>Promise.resolve().then(()=>require("./McChoices-BDsJqV2C.cjs"))),mcSolution:r(()=>Promise.resolve().then(()=>require("./McSolution-5feP69N7.cjs")))},R={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")))},$={doc:r(()=>Promise.resolve().then(()=>require("./Doc-D2yvlSII.cjs"))),slotNode:r(()=>Promise.resolve().then(()=>require("./SlotNode-DqwL4TkF.cjs")))},A={...y,...B,...b,...C,...x,...M,...I,...L,...N,...R,...$,...w},u=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(A)[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})}}}),E={class:"tree-render"},S=e.defineComponent({__name:"TreeRender",props:{node:{},axios:{}},setup(o){return e.provide(m,l),e.provide(a,o.axios),e.watch(()=>o.node,t=>{l.value=p(t)},{immediate:!0}),(t,n)=>(e.openBlock(),e.createElementBlock("div",E,[e.createVNode(u,{node:o.node},null,8,["node"])]))}});exports._export_sfc=c;exports._sfc_main=u;exports._sfc_main$1=S;exports.axiosKey=a;exports.imageNodesKey=m;