@datawhale/prosemirror-render 0.0.9 → 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 (44) hide show
  1. package/dist/{AttachmentBlock-C4Swmd2b.js → AttachmentBlock-CV4bIQNR.js} +2 -2
  2. package/dist/{AttachmentBlock-CiL-Qygv.cjs → AttachmentBlock-u8HLmuS1.cjs} +1 -1
  3. package/dist/{AttachmentInline-DLTAOygO.cjs → AttachmentInline-CiXvLJgR.cjs} +1 -1
  4. package/dist/{AttachmentInline-BU5AUs28.js → AttachmentInline-DGSYiwrS.js} +2 -2
  5. package/dist/{AttachmentMenu-DiZhh_3u.cjs → AttachmentMenu-5CeR8pic.cjs} +1 -1
  6. package/dist/{AttachmentMenu-DLlR5CXP.js → AttachmentMenu-DuCu2jWV.js} +1 -1
  7. package/dist/{Callout-D7puQgnx.cjs → Callout-DdgZnqvM.cjs} +1 -1
  8. package/dist/{Callout-DbKFrj5N.js → Callout-tf3Yg9S0.js} +1 -1
  9. package/dist/{CellOutput-C1rqdLdu.cjs → CellOutput-ByX6jmZM.cjs} +1 -1
  10. package/dist/{CellOutput-EzCS35bu.js → CellOutput-CMALyDYd.js} +1 -1
  11. package/dist/{CodeBlock-SLlc17jY.cjs → CodeBlock--7qFlRWP.cjs} +1 -1
  12. package/dist/{CodeBlock-XUiYN99W.js → CodeBlock-DbEjF_Kw.js} +1 -1
  13. package/dist/{FoldBlock-HqRqlt3p.js → FoldBlock-BCk2e21I.js} +1 -1
  14. package/dist/{FoldBlock-D9f0newS.cjs → FoldBlock-BQg9IBMS.cjs} +1 -1
  15. package/dist/{Grid-DJCw7wkB.js → Grid-Bovh5nmY.js} +1 -1
  16. package/dist/{Grid-cLwFeDko.cjs → Grid-D1kpeK1V.cjs} +1 -1
  17. package/dist/{IFrame-CQqNUygF.cjs → IFrame-D75ApJe8.cjs} +1 -1
  18. package/dist/{IFrame-CreFeGw0.js → IFrame-DXfrrRuk.js} +1 -1
  19. package/dist/{Image-B4Qy6xlu.js → Image--yswo9C1.js} +1 -1
  20. package/dist/{Image-DXcI8Q6W.cjs → Image-CGZEmHYK.cjs} +1 -1
  21. package/dist/{MathDisplay-C1YaBdrr.js → MathDisplay-BvE50YWq.js} +1 -1
  22. package/dist/{MathDisplay-gzdi6eYn.cjs → MathDisplay-CzQ0qRuW.cjs} +1 -1
  23. package/dist/{MathInline-CHMg8M3j.js → MathInline-G9q6yivs.js} +1 -1
  24. package/dist/{MathInline-Dog67RDU.cjs → MathInline-QqoFc5JE.cjs} +1 -1
  25. package/dist/{McChoices-LBSYtxIG.js → McChoices-1azqAf-m.js} +1 -1
  26. package/dist/{McChoices-C3ry5JEW.cjs → McChoices-CfywiCEs.cjs} +1 -1
  27. package/dist/{McQuestion-DNZ1Cg8x.cjs → McQuestion-Ba3qJ-FL.cjs} +1 -1
  28. package/dist/{McQuestion-BAxgspnR.js → McQuestion-CnCOlxBk.js} +1 -1
  29. package/dist/{McSolution-Bd70JP5F.cjs → McSolution-BOHaq8_k.cjs} +1 -1
  30. package/dist/{McSolution-B8Ir0TDg.js → McSolution-DDA7Qhyl.js} +1 -1
  31. package/dist/{MultipleChoice-bj3npcmx.js → MultipleChoice-DhJ3_sA0.js} +4 -4
  32. package/dist/{MultipleChoice-mDLIyHfi.cjs → MultipleChoice-v1ID9wsB.cjs} +1 -1
  33. package/dist/{Paragraph-HLV7U0CS.js → Paragraph-C3vQjERf.js} +1 -1
  34. package/dist/{Paragraph-Bx8A4csJ.cjs → Paragraph-Cbwrf0Ax.cjs} +1 -1
  35. package/dist/{SlotNode-CtJD0kba.js → SlotNode-Cj9OQ-yJ.js} +1 -1
  36. package/dist/{SlotNode-C_X3NC06.cjs → SlotNode-D5z9YYAl.cjs} +1 -1
  37. package/dist/{Text-DZM1Me1W.js → Text-Bcy8ncuu.js} +1 -1
  38. package/dist/{Text-C_OxsnsP.cjs → Text-Df2yJUWR.cjs} +1 -1
  39. package/dist/{index-DZ9p1utK.js → index-DO0f6PZF.js} +20 -18
  40. package/dist/index-emRMM6uw.cjs +1 -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
@@ -1,5 +1,7 @@
1
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
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
  };
@@ -42,11 +44,11 @@ function oe(t) {
42
44
  }), o;
43
45
  }
44
46
  const K = {
45
- "attachment-inline": e(() => import("./AttachmentInline-BU5AUs28.js")),
46
- "attachment-block": e(() => import("./AttachmentBlock-C4Swmd2b.js"))
47
+ "attachment-inline": e(() => import("./AttachmentInline-DGSYiwrS.js")),
48
+ "attachment-block": e(() => import("./AttachmentBlock-CV4bIQNR.js"))
47
49
  }, P = {
48
- text: e(() => import("./Text-DZM1Me1W.js")),
49
- paragraph: e(() => import("./Paragraph-HLV7U0CS.js")),
50
+ text: e(() => import("./Text-Bcy8ncuu.js")),
51
+ paragraph: e(() => import("./Paragraph-C3vQjERf.js")),
50
52
  heading: e(() => import("./Heading-BElRvhGn.js")),
51
53
  orderedList: e(() => import("./OrderedList-B8v1gchv.js")),
52
54
  bulletList: e(() => import("./BulletList-BQTUD69X.js")),
@@ -55,26 +57,26 @@ const K = {
55
57
  blockquote: e(() => import("./Blockquote-BamWUQND.js")),
56
58
  hardBreak: e(() => import("./HardBreak-B2tFO31P.js"))
57
59
  }, V = {
58
- callout: e(() => import("./Callout-DbKFrj5N.js"))
60
+ callout: e(() => import("./Callout-tf3Yg9S0.js"))
59
61
  }, z = {
60
- codeBlock: e(() => import("./CodeBlock-XUiYN99W.js")),
61
- cellOutput: e(() => import("./CellOutput-EzCS35bu.js"))
62
+ codeBlock: e(() => import("./CodeBlock-DbEjF_Kw.js")),
63
+ cellOutput: e(() => import("./CellOutput-CMALyDYd.js"))
62
64
  }, F = {
63
- foldBlock: e(() => import("./FoldBlock-HqRqlt3p.js"))
65
+ foldBlock: e(() => import("./FoldBlock-BCk2e21I.js"))
64
66
  }, Q = {
65
- grid: e(() => import("./Grid-DJCw7wkB.js"))
67
+ grid: e(() => import("./Grid-Bovh5nmY.js"))
66
68
  }, j = {
67
- iframe: e(() => import("./IFrame-CreFeGw0.js"))
69
+ iframe: e(() => import("./IFrame-DXfrrRuk.js"))
68
70
  }, G = {
69
- image: e(() => import("./Image-B4Qy6xlu.js"))
71
+ image: e(() => import("./Image--yswo9C1.js"))
70
72
  }, J = {
71
- math_inline: e(() => import("./MathInline-CHMg8M3j.js")),
72
- math_display: e(() => import("./MathDisplay-C1YaBdrr.js"))
73
+ math_inline: e(() => import("./MathInline-G9q6yivs.js")),
74
+ math_display: e(() => import("./MathDisplay-BvE50YWq.js"))
73
75
  }, 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"))
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"))
78
80
  }, W = {
79
81
  table: e(() => import("./TableContainer-C9PhNGlz.js")),
80
82
  tableHeader: e(() => import("./TableHeader-C7KKz3e1.js")),
@@ -82,7 +84,7 @@ const K = {
82
84
  tableCell: e(() => import("./TableCell-Bp52L368.js"))
83
85
  }, X = {
84
86
  doc: e(() => import("./Doc-6s4VMDsx.js")),
85
- slotNode: e(() => import("./SlotNode-CtJD0kba.js"))
87
+ slotNode: e(() => import("./SlotNode-Cj9OQ-yJ.js"))
86
88
  }, Y = {
87
89
  ...K,
88
90
  // 附件和视频类型
@@ -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-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-emRMM6uw.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-DO0f6PZF.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.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([]),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=_;