@datawhale/prosemirror-render 0.0.11 → 0.0.13

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 (47) hide show
  1. package/dist/{AttachmentBlock-D09C_Xeo.cjs → AttachmentBlock-CwX3vKZz.cjs} +1 -1
  2. package/dist/{AttachmentBlock-B-CPjKP3.js → AttachmentBlock-DhpdNcsY.js} +2 -2
  3. package/dist/{AttachmentInline-CJDSD0LJ.cjs → AttachmentInline-Dn4BgRWn.cjs} +1 -1
  4. package/dist/{AttachmentInline-CiFkwiIA.js → AttachmentInline-DxOVlVHB.js} +2 -2
  5. package/dist/{AttachmentMenu-977dJXFy.cjs → AttachmentMenu-6ypnGXC1.cjs} +1 -1
  6. package/dist/{AttachmentMenu-r8CfAUvn.js → AttachmentMenu-CHWAkWgA.js} +1 -1
  7. package/dist/{Callout-CSjUzN_N.js → Callout-BBycnf2d.js} +1 -1
  8. package/dist/{Callout-NbHZJyDc.cjs → Callout-C1e_cAKF.cjs} +1 -1
  9. package/dist/{CellOutput-bg5dZJRU.cjs → CellOutput-JRSAYYQT.cjs} +1 -1
  10. package/dist/{CellOutput-DCwREnyw.js → CellOutput-ZcOkS0kM.js} +1 -1
  11. package/dist/{CodeBlock-C5h9qR7-.js → CodeBlock-CtfUHlLj.js} +1 -1
  12. package/dist/{CodeBlock-CyZsJI3V.cjs → CodeBlock-ovZ6cl62.cjs} +1 -1
  13. package/dist/{FoldBlock-BPPYFA3-.js → FoldBlock-CzE0kzsq.js} +1 -1
  14. package/dist/{FoldBlock-Bcs5JiHU.cjs → FoldBlock-kUYGchSA.cjs} +1 -1
  15. package/dist/{Grid-CcORFpD_.cjs → Grid-YUCX0-9W.cjs} +1 -1
  16. package/dist/{Grid-xaKYzAXE.js → Grid-dDnIRDMx.js} +1 -1
  17. package/dist/{IFrame-BSaC6Crx.cjs → IFrame-BzrNcf_V.cjs} +1 -1
  18. package/dist/{IFrame-Bm7hVTn1.js → IFrame-DxsrQn8D.js} +1 -1
  19. package/dist/{Image-FdeYb5BV.js → Image-BskalmBE.js} +32 -33
  20. package/dist/Image-DceNmigN.cjs +1 -0
  21. package/dist/{MathDisplay-DaHoPzzZ.js → MathDisplay-BjVnQPNF.js} +1 -1
  22. package/dist/{MathDisplay-DFJMKfYF.cjs → MathDisplay-Cqw1buP4.cjs} +1 -1
  23. package/dist/{MathInline-0Air3WEh.js → MathInline-C-_FOWO5.js} +1 -1
  24. package/dist/{MathInline-BYYosI9r.cjs → MathInline-DeFaz_fm.cjs} +1 -1
  25. package/dist/{McChoices-CDitPkx-.js → McChoices-COfmZHyZ.js} +1 -1
  26. package/dist/{McChoices-DRLOXT0T.cjs → McChoices-CwBr5kbD.cjs} +1 -1
  27. package/dist/{McQuestion-DUNAdIm_.cjs → McQuestion-CQCC2rhl.cjs} +1 -1
  28. package/dist/{McQuestion-BvXVduhC.js → McQuestion-CaGshc0r.js} +1 -1
  29. package/dist/{McSolution-BXbQ_FWi.cjs → McSolution-DHLkN1VT.cjs} +1 -1
  30. package/dist/{McSolution-Dl9FFT_T.js → McSolution-DtUmBiMb.js} +1 -1
  31. package/dist/{MultipleChoice-Fp1_IXwl.js → MultipleChoice-68fjeO9Q.js} +4 -4
  32. package/dist/{MultipleChoice-6A5OOg1-.cjs → MultipleChoice-D-osFDr-.cjs} +1 -1
  33. package/dist/{Paragraph-CzTt-rpI.cjs → Paragraph-CoFzk7uY.cjs} +1 -1
  34. package/dist/{Paragraph-f_Rthafy.js → Paragraph-KwYZ3rM_.js} +1 -1
  35. package/dist/{SlotNode-qzG5ZNOp.js → SlotNode-BCUSUqyG.js} +1 -1
  36. package/dist/{SlotNode-CuocYkZX.cjs → SlotNode-CBSHeZa9.cjs} +1 -1
  37. package/dist/{Text-DJus401M.js → Text-Cm_u6_SK.js} +1 -1
  38. package/dist/{Text-u692xIqa.cjs → Text-fh71weuh.cjs} +1 -1
  39. package/dist/index-CJ7pfrkT.js +186 -0
  40. package/dist/index-twq62wD7.cjs +1 -0
  41. package/dist/index.cjs.js +1 -1
  42. package/dist/index.es.js +1 -1
  43. package/dist/prosemirror-render.css +1 -1
  44. package/package.json +1 -1
  45. package/dist/Image-BWbQijjz.cjs +0 -1
  46. package/dist/index-D1CitI3Z.cjs +0 -1
  47. package/dist/index-Lb864EoT.js +0 -182
@@ -1,182 +0,0 @@
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
- };