@datawhale/prosemirror-render 0.0.8 → 0.0.9
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.
- package/dist/{AttachmentBlock-CTvDbAcS.js → AttachmentBlock-C4Swmd2b.js} +2 -2
- package/dist/{AttachmentBlock-P1jG1cGY.cjs → AttachmentBlock-CiL-Qygv.cjs} +1 -1
- package/dist/{AttachmentInline-B7Cj5QJ0.js → AttachmentInline-BU5AUs28.js} +2 -2
- package/dist/{AttachmentInline-Cr4Zec57.cjs → AttachmentInline-DLTAOygO.cjs} +1 -1
- package/dist/{AttachmentMenu-CM2tOV0z.js → AttachmentMenu-DLlR5CXP.js} +1 -1
- package/dist/{AttachmentMenu-ChIj7hE3.cjs → AttachmentMenu-DiZhh_3u.cjs} +1 -1
- package/dist/{Callout-DazLxdGD.cjs → Callout-D7puQgnx.cjs} +1 -1
- package/dist/{Callout-Def3dYjo.js → Callout-DbKFrj5N.js} +1 -1
- package/dist/{CellOutput-B26_5ev3.cjs → CellOutput-C1rqdLdu.cjs} +1 -1
- package/dist/{CellOutput-Dbg8ZL0H.js → CellOutput-EzCS35bu.js} +1 -1
- package/dist/{CodeBlock-D8In7xR8.cjs → CodeBlock-SLlc17jY.cjs} +1 -1
- package/dist/{CodeBlock-BsqBkTD3.js → CodeBlock-XUiYN99W.js} +1 -1
- package/dist/{FoldBlock-BuwPwAaK.cjs → FoldBlock-D9f0newS.cjs} +1 -1
- package/dist/{FoldBlock-B_C9Qoy9.js → FoldBlock-HqRqlt3p.js} +1 -1
- package/dist/{Grid-B79na0-H.js → Grid-DJCw7wkB.js} +1 -1
- package/dist/{Grid-DvLYfpeG.cjs → Grid-cLwFeDko.cjs} +1 -1
- package/dist/{IFrame-ChfURc_t.cjs → IFrame-CQqNUygF.cjs} +1 -1
- package/dist/{IFrame-BXfWlAkB.js → IFrame-CreFeGw0.js} +1 -1
- package/dist/{Image-RwlDCWBT.js → Image-B4Qy6xlu.js} +1 -1
- package/dist/{Image-BAy3DLIi.cjs → Image-DXcI8Q6W.cjs} +1 -1
- package/dist/{MathDisplay-fiHorxPn.js → MathDisplay-C1YaBdrr.js} +1 -1
- package/dist/{MathDisplay-C0esLx5a.cjs → MathDisplay-gzdi6eYn.cjs} +1 -1
- package/dist/{MathInline-gFzVPQ0D.js → MathInline-CHMg8M3j.js} +1 -1
- package/dist/{MathInline-CnkNthuZ.cjs → MathInline-Dog67RDU.cjs} +1 -1
- package/dist/{McChoices-BDsJqV2C.cjs → McChoices-C3ry5JEW.cjs} +1 -1
- package/dist/{McChoices-DDKPec4G.js → McChoices-LBSYtxIG.js} +1 -1
- package/dist/{McQuestion-1efXXh4O.js → McQuestion-BAxgspnR.js} +1 -1
- package/dist/{McQuestion-CChLZMYt.cjs → McQuestion-DNZ1Cg8x.cjs} +1 -1
- package/dist/{McSolution-XXRJWaYt.js → McSolution-B8Ir0TDg.js} +1 -1
- package/dist/{McSolution-5feP69N7.cjs → McSolution-Bd70JP5F.cjs} +1 -1
- package/dist/{MultipleChoice-DT_c5R8o.js → MultipleChoice-bj3npcmx.js} +4 -4
- package/dist/{MultipleChoice-CQ9cbLUg.cjs → MultipleChoice-mDLIyHfi.cjs} +1 -1
- package/dist/{Paragraph-nAepKpbl.cjs → Paragraph-Bx8A4csJ.cjs} +1 -1
- package/dist/{Paragraph-CWn5tuOy.js → Paragraph-HLV7U0CS.js} +1 -1
- package/dist/{SlotNode-DqwL4TkF.cjs → SlotNode-C_X3NC06.cjs} +1 -1
- package/dist/{SlotNode-BhXyQCzg.js → SlotNode-CtJD0kba.js} +1 -1
- package/dist/{Text-CS6RYM2H.cjs → Text-C_OxsnsP.cjs} +1 -1
- package/dist/{Text-Nb_IXPkh.js → Text-DZM1Me1W.js} +1 -1
- package/dist/index-B4Ca4BP0.cjs +1 -0
- package/dist/{index-CTcnNF6r.js → index-DZ9p1utK.js} +68 -51
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +3 -2
- package/dist/types/components/index.d.ts +0 -1
- package/dist/types/index.d.ts +2 -1
- package/package.json +1 -1
- package/dist/index-kIuhy4WL.cjs +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ref as g, createElementBlock as s, openBlock as c, defineAsyncComponent as
|
|
2
|
-
const
|
|
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
3
|
const o = [], n = (r) => {
|
|
4
4
|
r.type === "image" && o.push(r), r.content && r.content.forEach((a) => n(a));
|
|
5
5
|
};
|
|
@@ -9,28 +9,44 @@ const A = /* @__PURE__ */ Symbol(), p = g([]), N = /* @__PURE__ */ Symbol(), S =
|
|
|
9
9
|
for (const [r, a] of o)
|
|
10
10
|
n[r] = a;
|
|
11
11
|
return n;
|
|
12
|
-
}, $ = {},
|
|
13
|
-
function
|
|
14
|
-
return c(), s("div",
|
|
12
|
+
}, $ = {}, E = { class: "error-wrapper" };
|
|
13
|
+
function T(t, o) {
|
|
14
|
+
return c(), s("div", E, "组件加载失败");
|
|
15
15
|
}
|
|
16
|
-
const
|
|
17
|
-
function
|
|
16
|
+
const D = /* @__PURE__ */ u($, [["render", T], ["__scopeId", "data-v-4fa940a8"]]), O = {};
|
|
17
|
+
function q(t, o) {
|
|
18
18
|
return "loading...";
|
|
19
19
|
}
|
|
20
|
-
const
|
|
21
|
-
loadingComponent:
|
|
20
|
+
const H = /* @__PURE__ */ u(O, [["render", q]]), e = (t, o = {
|
|
21
|
+
loadingComponent: H,
|
|
22
22
|
delay: 200,
|
|
23
|
-
errorComponent:
|
|
23
|
+
errorComponent: D,
|
|
24
24
|
timeout: 5e3
|
|
25
|
-
}) =>
|
|
25
|
+
}) => y({
|
|
26
26
|
loader: t,
|
|
27
27
|
...o
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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")),
|
|
34
50
|
heading: e(() => import("./Heading-BElRvhGn.js")),
|
|
35
51
|
orderedList: e(() => import("./OrderedList-B8v1gchv.js")),
|
|
36
52
|
bulletList: e(() => import("./BulletList-BQTUD69X.js")),
|
|
@@ -38,27 +54,27 @@ const K = /* @__PURE__ */ u(q, [["render", D]]), e = (t, o = {
|
|
|
38
54
|
horizontalRule: e(() => import("./HorizontalRule-BRG45oT0.js")),
|
|
39
55
|
blockquote: e(() => import("./Blockquote-BamWUQND.js")),
|
|
40
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"))
|
|
41
62
|
}, F = {
|
|
42
|
-
|
|
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"))
|
|
63
|
+
foldBlock: e(() => import("./FoldBlock-HqRqlt3p.js"))
|
|
48
64
|
}, Q = {
|
|
49
|
-
grid: e(() => import("./Grid-
|
|
65
|
+
grid: e(() => import("./Grid-DJCw7wkB.js"))
|
|
50
66
|
}, j = {
|
|
51
|
-
iframe: e(() => import("./IFrame-
|
|
67
|
+
iframe: e(() => import("./IFrame-CreFeGw0.js"))
|
|
52
68
|
}, G = {
|
|
53
|
-
image: e(() => import("./Image-
|
|
69
|
+
image: e(() => import("./Image-B4Qy6xlu.js"))
|
|
54
70
|
}, J = {
|
|
55
|
-
math_inline: e(() => import("./MathInline-
|
|
56
|
-
math_display: e(() => import("./MathDisplay-
|
|
71
|
+
math_inline: e(() => import("./MathInline-CHMg8M3j.js")),
|
|
72
|
+
math_display: e(() => import("./MathDisplay-C1YaBdrr.js"))
|
|
57
73
|
}, U = {
|
|
58
|
-
multipleChoice: e(() => import("./MultipleChoice-
|
|
59
|
-
mcQuestion: e(() => import("./McQuestion-
|
|
60
|
-
mcChoices: e(() => import("./McChoices-
|
|
61
|
-
mcSolution: e(() => import("./McSolution-
|
|
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"))
|
|
62
78
|
}, W = {
|
|
63
79
|
table: e(() => import("./TableContainer-C9PhNGlz.js")),
|
|
64
80
|
tableHeader: e(() => import("./TableHeader-C7KKz3e1.js")),
|
|
@@ -66,17 +82,17 @@ const K = /* @__PURE__ */ u(q, [["render", D]]), e = (t, o = {
|
|
|
66
82
|
tableCell: e(() => import("./TableCell-Bp52L368.js"))
|
|
67
83
|
}, X = {
|
|
68
84
|
doc: e(() => import("./Doc-6s4VMDsx.js")),
|
|
69
|
-
slotNode: e(() => import("./SlotNode-
|
|
85
|
+
slotNode: e(() => import("./SlotNode-CtJD0kba.js"))
|
|
70
86
|
}, Y = {
|
|
71
|
-
...
|
|
87
|
+
...K,
|
|
72
88
|
// 附件和视频类型
|
|
73
|
-
...
|
|
89
|
+
...P,
|
|
74
90
|
// 基础类型,包括各种字体样式
|
|
75
|
-
...
|
|
91
|
+
...V,
|
|
76
92
|
// 高亮块
|
|
77
|
-
...
|
|
93
|
+
...z,
|
|
78
94
|
// 代码块
|
|
79
|
-
...
|
|
95
|
+
...F,
|
|
80
96
|
// 折叠块
|
|
81
97
|
...Q,
|
|
82
98
|
// 分栏
|
|
@@ -114,14 +130,14 @@ const K = /* @__PURE__ */ u(q, [["render", D]]), e = (t, o = {
|
|
|
114
130
|
"table",
|
|
115
131
|
"iframe",
|
|
116
132
|
"multipleChoice"
|
|
117
|
-
]), n =
|
|
133
|
+
]), n = k(() => o.has(t.node.type) && t.node.attrs && t.node.attrs["block-id"] ? { "data-block-id": t.node.attrs["block-id"] } : {});
|
|
118
134
|
return (r, a) => {
|
|
119
|
-
const f =
|
|
120
|
-
return c(), i(
|
|
121
|
-
default:
|
|
135
|
+
const f = _("TreeRecursive", !0);
|
|
136
|
+
return c(), i(b, null, {
|
|
137
|
+
default: l(() => [
|
|
122
138
|
(c(), i(C(v(Y)[t.node.type]), M({ node: t.node }, n.value), {
|
|
123
|
-
default:
|
|
124
|
-
t.node.content && !(t.node.type in ["foldBlock", "grid", "callout"]) ? (c(!0), s(x, { key: 0 },
|
|
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, {
|
|
125
141
|
node: h,
|
|
126
142
|
key: I()
|
|
127
143
|
}, null, 8, ["node"]))), 128)) : B("", !0)
|
|
@@ -133,28 +149,29 @@ const K = /* @__PURE__ */ u(q, [["render", D]]), e = (t, o = {
|
|
|
133
149
|
});
|
|
134
150
|
};
|
|
135
151
|
}
|
|
136
|
-
}), ee = { class: "tree-render" },
|
|
152
|
+
}), ee = { class: "tree-render" }, ne = /* @__PURE__ */ d({
|
|
137
153
|
__name: "TreeRender",
|
|
138
154
|
props: {
|
|
139
155
|
node: {},
|
|
140
156
|
axios: {}
|
|
141
157
|
},
|
|
142
158
|
setup(t) {
|
|
143
|
-
return
|
|
159
|
+
return p(N, m), p(R, t.axios), w(
|
|
144
160
|
() => t.node,
|
|
145
161
|
(o) => {
|
|
146
|
-
|
|
162
|
+
m.value = S(o);
|
|
147
163
|
},
|
|
148
164
|
{ immediate: !0 }
|
|
149
165
|
), (o, n) => (c(), s("div", ee, [
|
|
150
|
-
|
|
166
|
+
L(Z, { node: t.node }, null, 8, ["node"])
|
|
151
167
|
]));
|
|
152
168
|
}
|
|
153
169
|
});
|
|
154
170
|
export {
|
|
155
171
|
u as _,
|
|
156
|
-
|
|
172
|
+
R as a,
|
|
157
173
|
Z as b,
|
|
158
|
-
|
|
159
|
-
N as i
|
|
174
|
+
ne as c,
|
|
175
|
+
N as i,
|
|
176
|
+
oe as s
|
|
160
177
|
};
|
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
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;
|
package/dist/index.es.js
CHANGED
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
package/dist/index-kIuhy4WL.cjs
DELETED
|
@@ -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;
|