@datawhale/prosemirror-render 0.0.13 → 0.0.14
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-DhpdNcsY.js → AttachmentBlock-ByHtTWuI.js} +2 -2
- package/dist/{AttachmentBlock-CwX3vKZz.cjs → AttachmentBlock-tnlBhmh1.cjs} +1 -1
- package/dist/{AttachmentInline-Dn4BgRWn.cjs → AttachmentInline-B1iq2ZzJ.cjs} +1 -1
- package/dist/{AttachmentInline-DxOVlVHB.js → AttachmentInline-CVcQynCS.js} +2 -2
- package/dist/{AttachmentMenu-6ypnGXC1.cjs → AttachmentMenu-BFzuLVvs.cjs} +1 -1
- package/dist/{AttachmentMenu-CHWAkWgA.js → AttachmentMenu-oBI7t5eW.js} +1 -1
- package/dist/{Callout-BBycnf2d.js → Callout-CAAjU4gc.js} +1 -1
- package/dist/{Callout-C1e_cAKF.cjs → Callout-CZlxGY4m.cjs} +1 -1
- package/dist/{CellOutput-JRSAYYQT.cjs → CellOutput-B0B-15G4.cjs} +1 -1
- package/dist/{CellOutput-ZcOkS0kM.js → CellOutput-CSND51qF.js} +1 -1
- package/dist/{CodeBlock-ovZ6cl62.cjs → CodeBlock-C-HQYt0D.cjs} +1 -1
- package/dist/{CodeBlock-CtfUHlLj.js → CodeBlock-esh4GRUm.js} +1 -1
- package/dist/{FoldBlock-kUYGchSA.cjs → FoldBlock-DPjAMxNU.cjs} +1 -1
- package/dist/{FoldBlock-CzE0kzsq.js → FoldBlock-GqZ4Q6gf.js} +1 -1
- package/dist/{Grid-YUCX0-9W.cjs → Grid-CWblUZA1.cjs} +1 -1
- package/dist/{Grid-dDnIRDMx.js → Grid-DgWoulAe.js} +1 -1
- package/dist/{IFrame-DxsrQn8D.js → IFrame-BZYrBDpx.js} +1 -1
- package/dist/{IFrame-BzrNcf_V.cjs → IFrame-Ch4uHCg5.cjs} +1 -1
- package/dist/{Image-BskalmBE.js → Image-BGDBIQBQ.js} +1 -1
- package/dist/{Image-DceNmigN.cjs → Image-DO6aHhWw.cjs} +1 -1
- package/dist/{MathDisplay-BjVnQPNF.js → MathDisplay-C0EWPqfF.js} +1 -1
- package/dist/{MathDisplay-Cqw1buP4.cjs → MathDisplay-C9wXYcrr.cjs} +1 -1
- package/dist/{MathInline-C-_FOWO5.js → MathInline-BnR24HSK.js} +1 -1
- package/dist/{MathInline-DeFaz_fm.cjs → MathInline-CRd3OFdA.cjs} +1 -1
- package/dist/{McChoices-CwBr5kbD.cjs → McChoices-BRXKs2zr.cjs} +1 -1
- package/dist/{McChoices-COfmZHyZ.js → McChoices-C5FkOVA3.js} +1 -1
- package/dist/{McQuestion-CaGshc0r.js → McQuestion-Ctvd6D_8.js} +1 -1
- package/dist/{McQuestion-CQCC2rhl.cjs → McQuestion-DZnm3GYh.cjs} +1 -1
- package/dist/{McSolution-DtUmBiMb.js → McSolution-CIp9mRqD.js} +1 -1
- package/dist/{McSolution-DHLkN1VT.cjs → McSolution-Ddp2JqTg.cjs} +1 -1
- package/dist/{MultipleChoice-68fjeO9Q.js → MultipleChoice-BLWPtgSX.js} +4 -4
- package/dist/{MultipleChoice-D-osFDr-.cjs → MultipleChoice-Dn1ewqwh.cjs} +1 -1
- package/dist/{Paragraph-CoFzk7uY.cjs → Paragraph-D9tNHRR2.cjs} +1 -1
- package/dist/{Paragraph-KwYZ3rM_.js → Paragraph-WPKhTw9U.js} +1 -1
- package/dist/{SlotNode-CBSHeZa9.cjs → SlotNode-CuhFzL_Q.cjs} +1 -1
- package/dist/{SlotNode-BCUSUqyG.js → SlotNode-mfYYyUtZ.js} +1 -1
- package/dist/{Text-fh71weuh.cjs → Text-CO8w66wD.cjs} +1 -1
- package/dist/{Text-Cm_u6_SK.js → Text-Cs5aiGbS.js} +1 -1
- package/dist/VideoPlayer-BEvuUlWw.cjs +1 -0
- package/dist/VideoPlayer-CN37442r.js +33 -0
- package/dist/index-C3GRUUlT.cjs +1 -0
- package/dist/index-Dnk-53ct.js +217 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +4 -3
- package/dist/prosemirror-render.css +1 -1
- package/dist/types/components/MediaRender.vue.d.ts +9 -0
- package/dist/types/components/collections/file/VideoPlayer.vue.d.ts +7 -0
- package/dist/types/components/collections/file/index.d.ts +1 -0
- package/dist/types/components/collections/utils.d.ts +11 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/types.d.ts +10 -0
- package/package.json +1 -1
- package/dist/index-CJ7pfrkT.js +0 -186
- package/dist/index-twq62wD7.cjs +0 -1
package/dist/index-CJ7pfrkT.js
DELETED
|
@@ -1,186 +0,0 @@
|
|
|
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-DxOVlVHB.js")),
|
|
52
|
-
"attachment-block": e(() => import("./AttachmentBlock-DhpdNcsY.js"))
|
|
53
|
-
}, K = {
|
|
54
|
-
text: e(() => import("./Text-Cm_u6_SK.js")),
|
|
55
|
-
paragraph: e(() => import("./Paragraph-KwYZ3rM_.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-BBycnf2d.js"))
|
|
65
|
-
}, z = {
|
|
66
|
-
codeBlock: e(() => import("./CodeBlock-CtfUHlLj.js")),
|
|
67
|
-
cellOutput: e(() => import("./CellOutput-ZcOkS0kM.js"))
|
|
68
|
-
}, F = {
|
|
69
|
-
foldBlock: e(() => import("./FoldBlock-CzE0kzsq.js"))
|
|
70
|
-
}, Q = {
|
|
71
|
-
grid: e(() => import("./Grid-dDnIRDMx.js"))
|
|
72
|
-
}, V = {
|
|
73
|
-
iframe: e(() => import("./IFrame-DxsrQn8D.js"))
|
|
74
|
-
}, j = {
|
|
75
|
-
image: e(() => import("./Image-BskalmBE.js"))
|
|
76
|
-
}, G = {
|
|
77
|
-
math_inline: e(() => import("./MathInline-C-_FOWO5.js")),
|
|
78
|
-
math_display: e(() => import("./MathDisplay-BjVnQPNF.js"))
|
|
79
|
-
}, J = {
|
|
80
|
-
multipleChoice: e(() => import("./MultipleChoice-68fjeO9Q.js")),
|
|
81
|
-
mcQuestion: e(() => import("./McQuestion-CaGshc0r.js")),
|
|
82
|
-
mcChoices: e(() => import("./McChoices-COfmZHyZ.js")),
|
|
83
|
-
mcSolution: e(() => import("./McSolution-DtUmBiMb.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-BCUSUqyG.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-twq62wD7.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),m=Symbol(),u=e.ref([]),d=Symbol(),p=r=>{if(!r)return[];const o=[],n=s=>{s.type==="image"&&o.push(s),s.content&&s.content.forEach(i=>n(i))};return n(r),o},l=(r,o)=>{const n=r.__vccOpts||r;for(const[s,i]of o)n[s]=i;return n},v={},f={class:"error-wrapper"};function k(r,o){return e.openBlock(),e.createElementBlock("div",f,"组件加载失败")}const g=l(v,[["render",k],["__scopeId","data-v-4fa940a8"]]),q={};function P(r,o){return"loading..."}const y=l(q,[["render",P]]),t=(r,o={loadingComponent:y,delay:200,errorComponent:g,timeout:5e3})=>e.defineAsyncComponent({loader:r,...o});function B(r){if(!r||!r.content)return[r];const o=[];let n=[],s=null;return r.content.forEach(i=>{if(i.type==="heading"||i.type==="heading"){const c=i.attrs?.level;s===null&&(s=c),c===s&&n.length>0&&(o.push({type:"doc",content:n}),n=[])}n.push(i)}),n.length>0&&o.push({type:"doc",content:n}),o}const _={"attachment-inline":t(()=>Promise.resolve().then(()=>require("./AttachmentInline-Dn4BgRWn.cjs"))),"attachment-block":t(()=>Promise.resolve().then(()=>require("./AttachmentBlock-CwX3vKZz.cjs")))},C={text:t(()=>Promise.resolve().then(()=>require("./Text-fh71weuh.cjs"))),paragraph:t(()=>Promise.resolve().then(()=>require("./Paragraph-CoFzk7uY.cjs"))),heading:t(()=>Promise.resolve().then(()=>require("./Heading-BUnffIAz.cjs"))),orderedList:t(()=>Promise.resolve().then(()=>require("./OrderedList-DMl3tvwP.cjs"))),bulletList:t(()=>Promise.resolve().then(()=>require("./BulletList-CFjF3U-l.cjs"))),listItem:t(()=>Promise.resolve().then(()=>require("./ListItem-BrjxeGxz.cjs"))),horizontalRule:t(()=>Promise.resolve().then(()=>require("./HorizontalRule-CE09LZGf.cjs"))),blockquote:t(()=>Promise.resolve().then(()=>require("./Blockquote-CQSBFnsu.cjs"))),hardBreak:t(()=>Promise.resolve().then(()=>require("./HardBreak-Dbf5Zg5o.cjs")))},b={callout:t(()=>Promise.resolve().then(()=>require("./Callout-C1e_cAKF.cjs")))},M={codeBlock:t(()=>Promise.resolve().then(()=>require("./CodeBlock-ovZ6cl62.cjs"))),cellOutput:t(()=>Promise.resolve().then(()=>require("./CellOutput-JRSAYYQT.cjs")))},x={foldBlock:t(()=>Promise.resolve().then(()=>require("./FoldBlock-kUYGchSA.cjs")))},I={grid:t(()=>Promise.resolve().then(()=>require("./Grid-YUCX0-9W.cjs")))},L={iframe:t(()=>Promise.resolve().then(()=>require("./IFrame-BzrNcf_V.cjs")))},w={image:t(()=>Promise.resolve().then(()=>require("./Image-DceNmigN.cjs")))},E={math_inline:t(()=>Promise.resolve().then(()=>require("./MathInline-DeFaz_fm.cjs"))),math_display:t(()=>Promise.resolve().then(()=>require("./MathDisplay-Cqw1buP4.cjs")))},N={multipleChoice:t(()=>Promise.resolve().then(()=>require("./MultipleChoice-D-osFDr-.cjs"))),mcQuestion:t(()=>Promise.resolve().then(()=>require("./McQuestion-CQCC2rhl.cjs"))),mcChoices:t(()=>Promise.resolve().then(()=>require("./McChoices-CwBr5kbD.cjs"))),mcSolution:t(()=>Promise.resolve().then(()=>require("./McSolution-DHLkN1VT.cjs")))},R={table:t(()=>Promise.resolve().then(()=>require("./TableContainer-C5KXY6f7.cjs"))),tableHeader:t(()=>Promise.resolve().then(()=>require("./TableHeader-BTuqvorM.cjs"))),tableRow:t(()=>Promise.resolve().then(()=>require("./TableRow-D4F6AKFt.cjs"))),tableCell:t(()=>Promise.resolve().then(()=>require("./TableCell-BY9gdldc.cjs")))},$={doc:t(()=>Promise.resolve().then(()=>require("./Doc-D2yvlSII.cjs"))),slotNode:t(()=>Promise.resolve().then(()=>require("./SlotNode-CBSHeZa9.cjs")))},A={..._,...C,...b,...M,...x,...I,...w,...E,...N,...R,...$,...L},h=e.defineComponent({__name:"TreeRecursive",props:{node:{}},setup(r){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(r.node.type)&&r.node.attrs&&r.node.attrs["block-id"]?{"data-block-id":r.node.attrs["block-id"]}:{});return(s,i)=>{const a=e.resolveComponent("TreeRecursive",!0);return e.openBlock(),e.createBlock(e.Suspense,null,{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(A)[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,c=>(e.openBlock(),e.createBlock(a,{node:c,key:e.useId()},null,8,["node"]))),128)):e.createCommentVNode("",!0)]),_:1},16,["node"]))]),_:1})}}}),H={class:"tree-render"},S=e.defineComponent({__name:"TreeRender",props:{node:{},axios:{}},setup(r){return e.provide(d,u),e.provide(m,r.axios),e.watch(()=>r.node,o=>{u.value=p(o)},{immediate:!0}),(o,n)=>(e.openBlock(),e.createElementBlock("div",H,[r.node?(e.openBlock(),e.createBlock(h,{key:0,node:r.node},null,8,["node"])):e.createCommentVNode("",!0)]))}});exports._export_sfc=l;exports._sfc_main=h;exports._sfc_main$1=S;exports.axiosKey=m;exports.imageNodesKey=d;exports.splitDocIntoMultiPagesByHeading=B;
|