@kong-ui-public/document-viewer 0.2.4 → 0.2.5
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/document-viewer.es.js +100 -98
- package/dist/document-viewer.es.js.map +1 -1
- package/dist/document-viewer.umd.js +1 -1
- package/dist/document-viewer.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/nodes/TextBlock.vue.d.ts +8 -1
- package/dist/types/components/nodes/TextBlock.vue.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { openBlock as
|
|
1
|
+
import { openBlock as o, createElementBlock as c, renderSlot as s, createElementVNode as y, defineComponent as l, createBlock as i, resolveDynamicComponent as f, unref as d, withCtx as p, normalizeClass as k, Fragment as x, createTextVNode as B, toDisplayString as C, createCommentVNode as I, createVNode as $, mergeProps as w } from "vue";
|
|
2
2
|
const _ = (e, t) => {
|
|
3
3
|
const n = e.__vccOpts || e;
|
|
4
|
-
for (const [
|
|
5
|
-
n[
|
|
4
|
+
for (const [r, a] of t)
|
|
5
|
+
n[r] = a;
|
|
6
6
|
return n;
|
|
7
|
-
},
|
|
8
|
-
function
|
|
9
|
-
return
|
|
10
|
-
|
|
7
|
+
}, N = {};
|
|
8
|
+
function q(e, t) {
|
|
9
|
+
return o(), c("blockquote", null, [
|
|
10
|
+
s(e.$slots, "default", {}, void 0, !0)
|
|
11
11
|
]);
|
|
12
12
|
}
|
|
13
|
-
const V = /* @__PURE__ */ _(
|
|
14
|
-
const
|
|
15
|
-
function
|
|
16
|
-
return
|
|
17
|
-
|
|
13
|
+
const V = /* @__PURE__ */ _(N, [["render", q], ["__scopeId", "data-v-a9ac327a"]]);
|
|
14
|
+
const L = {};
|
|
15
|
+
function S(e, t) {
|
|
16
|
+
return o(), c("code", null, [
|
|
17
|
+
s(e.$slots, "default", {}, void 0, !0)
|
|
18
18
|
]);
|
|
19
19
|
}
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
function
|
|
23
|
-
return
|
|
20
|
+
const T = /* @__PURE__ */ _(L, [["render", S], ["__scopeId", "data-v-015a6bbb"]]);
|
|
21
|
+
const D = {};
|
|
22
|
+
function O(e, t) {
|
|
23
|
+
return o(), c("pre", null, [
|
|
24
24
|
y("code", null, [
|
|
25
|
-
|
|
25
|
+
s(e.$slots, "default", {}, void 0, !0)
|
|
26
26
|
])
|
|
27
27
|
]);
|
|
28
28
|
}
|
|
29
|
-
const
|
|
29
|
+
const P = /* @__PURE__ */ _(D, [["render", O], ["__scopeId", "data-v-7d7d103e"]]), E = /* @__PURE__ */ l({
|
|
30
30
|
__name: "Emphasis",
|
|
31
31
|
props: {
|
|
32
32
|
level: {
|
|
@@ -42,14 +42,14 @@ const E = /* @__PURE__ */ _(O, [["render", P], ["__scopeId", "data-v-b214e96f"]]
|
|
|
42
42
|
},
|
|
43
43
|
setup(e) {
|
|
44
44
|
const n = e.level === 1 ? "em" : "strong";
|
|
45
|
-
return (
|
|
45
|
+
return (r, a) => (o(), i(f(d(n)), null, {
|
|
46
46
|
default: p(() => [
|
|
47
|
-
|
|
47
|
+
s(r.$slots, "default")
|
|
48
48
|
]),
|
|
49
49
|
_: 3
|
|
50
50
|
}));
|
|
51
51
|
}
|
|
52
|
-
}),
|
|
52
|
+
}), H = /* @__PURE__ */ l({
|
|
53
53
|
__name: "Heading",
|
|
54
54
|
props: {
|
|
55
55
|
level: {
|
|
@@ -65,15 +65,15 @@ const E = /* @__PURE__ */ _(O, [["render", P], ["__scopeId", "data-v-b214e96f"]]
|
|
|
65
65
|
},
|
|
66
66
|
setup(e) {
|
|
67
67
|
const n = `h${e.level}`;
|
|
68
|
-
return (
|
|
68
|
+
return (r, a) => (o(), i(f(n), null, {
|
|
69
69
|
default: p(() => [
|
|
70
|
-
|
|
70
|
+
s(r.$slots, "default", {}, void 0, !0)
|
|
71
71
|
]),
|
|
72
72
|
_: 3
|
|
73
73
|
}));
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
|
-
const
|
|
76
|
+
const j = /* @__PURE__ */ _(H, [["__scopeId", "data-v-07152ca1"]]), U = ["alt", "src", "title"], z = /* @__PURE__ */ l({
|
|
77
77
|
__name: "Image",
|
|
78
78
|
props: {
|
|
79
79
|
url: {
|
|
@@ -90,30 +90,30 @@ const U = /* @__PURE__ */ _(j, [["__scopeId", "data-v-07152ca1"]]), z = ["alt",
|
|
|
90
90
|
}
|
|
91
91
|
},
|
|
92
92
|
setup(e) {
|
|
93
|
-
return (t, n) => (
|
|
93
|
+
return (t, n) => (o(), c("figure", null, [
|
|
94
94
|
y("img", {
|
|
95
95
|
alt: e.alt,
|
|
96
96
|
src: e.url,
|
|
97
97
|
title: e.title
|
|
98
|
-
}, null, 8,
|
|
98
|
+
}, null, 8, U),
|
|
99
99
|
y("figcaption", null, [
|
|
100
|
-
|
|
100
|
+
s(t.$slots, "default")
|
|
101
101
|
])
|
|
102
102
|
]));
|
|
103
103
|
}
|
|
104
|
-
}),
|
|
105
|
-
function
|
|
106
|
-
return
|
|
104
|
+
}), F = {};
|
|
105
|
+
function M(e, t) {
|
|
106
|
+
return o(), c("hr");
|
|
107
107
|
}
|
|
108
|
-
const
|
|
109
|
-
function
|
|
110
|
-
return
|
|
111
|
-
|
|
108
|
+
const G = /* @__PURE__ */ _(F, [["render", M]]), J = {};
|
|
109
|
+
function K(e, t) {
|
|
110
|
+
return o(), c("table", null, [
|
|
111
|
+
s(e.$slots, "default")
|
|
112
112
|
]);
|
|
113
113
|
}
|
|
114
|
-
const
|
|
114
|
+
const Q = /* @__PURE__ */ _(J, [["render", K]]);
|
|
115
115
|
var u = /* @__PURE__ */ ((e) => (e.header = "header", e.body = "body", e.footer = "footer", e))(u || {}), m = /* @__PURE__ */ ((e) => (e.left = "left", e.center = "center", e.right = "right", e))(m || {});
|
|
116
|
-
const
|
|
116
|
+
const W = /* @__PURE__ */ l({
|
|
117
117
|
__name: "TableRow",
|
|
118
118
|
props: {
|
|
119
119
|
section: {
|
|
@@ -124,14 +124,14 @@ const X = /* @__PURE__ */ l({
|
|
|
124
124
|
setup(e) {
|
|
125
125
|
const t = e;
|
|
126
126
|
let n;
|
|
127
|
-
return t.section === u.header ? n = "thead" : t.section === u.body ? n = "tbody" : t.section === u.footer && (n = "tfoot"), (
|
|
127
|
+
return t.section === u.header ? n = "thead" : t.section === u.body ? n = "tbody" : t.section === u.footer && (n = "tfoot"), (r, a) => (o(), i(f(d(n)), null, {
|
|
128
128
|
default: p(() => [
|
|
129
|
-
|
|
129
|
+
s(r.$slots, "default")
|
|
130
130
|
]),
|
|
131
131
|
_: 3
|
|
132
132
|
}));
|
|
133
133
|
}
|
|
134
|
-
}),
|
|
134
|
+
}), X = /* @__PURE__ */ l({
|
|
135
135
|
__name: "TableCell",
|
|
136
136
|
props: {
|
|
137
137
|
align: {
|
|
@@ -146,21 +146,21 @@ const X = /* @__PURE__ */ l({
|
|
|
146
146
|
setup(e) {
|
|
147
147
|
var a;
|
|
148
148
|
const t = e, n = ((a = t.parent) == null ? void 0 : a.section) === u.header ? "th" : "td";
|
|
149
|
-
let
|
|
150
|
-
return t.align === m.center ?
|
|
151
|
-
class:
|
|
149
|
+
let r;
|
|
150
|
+
return t.align === m.center ? r = "align-center" : t.align === m.right && (r = "align-right"), (g, h) => (o(), i(f(d(n)), {
|
|
151
|
+
class: k(d(r))
|
|
152
152
|
}, {
|
|
153
153
|
default: p(() => [
|
|
154
|
-
|
|
154
|
+
s(g.$slots, "default", {}, void 0, !0)
|
|
155
155
|
]),
|
|
156
156
|
_: 3
|
|
157
157
|
}, 8, ["class"]));
|
|
158
158
|
}
|
|
159
159
|
});
|
|
160
|
-
const
|
|
160
|
+
const Y = /* @__PURE__ */ _(X, [["__scopeId", "data-v-6da63f53"]]), Z = { key: 0 }, A = {
|
|
161
161
|
inheritAttrs: !1
|
|
162
|
-
},
|
|
163
|
-
...
|
|
162
|
+
}, R = /* @__PURE__ */ l({
|
|
163
|
+
...A,
|
|
164
164
|
__name: "Text",
|
|
165
165
|
props: {
|
|
166
166
|
text: {
|
|
@@ -173,23 +173,25 @@ const Z = /* @__PURE__ */ _(Y, [["__scopeId", "data-v-6da63f53"]]), A = { key: 0
|
|
|
173
173
|
}
|
|
174
174
|
},
|
|
175
175
|
setup(e) {
|
|
176
|
-
return (t, n) => (
|
|
177
|
-
B(C(e.text)
|
|
178
|
-
e.hardBreak ? (
|
|
176
|
+
return (t, n) => (o(), c(x, null, [
|
|
177
|
+
B(C(e.text), 1),
|
|
178
|
+
e.hardBreak ? (o(), c("br", Z)) : I("", !0)
|
|
179
179
|
], 64));
|
|
180
180
|
}
|
|
181
|
-
}),
|
|
182
|
-
function
|
|
183
|
-
return
|
|
181
|
+
}), ee = {};
|
|
182
|
+
function te(e, t) {
|
|
183
|
+
return o(), c("span", null, [
|
|
184
|
+
s(e.$slots, "default")
|
|
185
|
+
]);
|
|
184
186
|
}
|
|
185
|
-
const
|
|
186
|
-
const
|
|
187
|
-
function
|
|
188
|
-
return
|
|
189
|
-
|
|
187
|
+
const ne = /* @__PURE__ */ _(ee, [["render", te]]);
|
|
188
|
+
const re = {};
|
|
189
|
+
function oe(e, t) {
|
|
190
|
+
return o(), c("p", null, [
|
|
191
|
+
s(e.$slots, "default", {}, void 0, !0)
|
|
190
192
|
]);
|
|
191
193
|
}
|
|
192
|
-
const
|
|
194
|
+
const se = /* @__PURE__ */ _(re, [["render", oe], ["__scopeId", "data-v-c7681718"]]), ce = /* @__PURE__ */ l({
|
|
193
195
|
__name: "List",
|
|
194
196
|
props: {
|
|
195
197
|
isOrdered: {
|
|
@@ -199,21 +201,21 @@ const ce = /* @__PURE__ */ _(oe, [["render", se], ["__scopeId", "data-v-c7681718
|
|
|
199
201
|
},
|
|
200
202
|
setup(e) {
|
|
201
203
|
const n = e.isOrdered ? "ol" : "ul";
|
|
202
|
-
return (
|
|
204
|
+
return (r, a) => (o(), i(f(d(n)), null, {
|
|
203
205
|
default: p(() => [
|
|
204
|
-
|
|
206
|
+
s(r.$slots, "default", {}, void 0, !0)
|
|
205
207
|
]),
|
|
206
208
|
_: 3
|
|
207
209
|
}));
|
|
208
210
|
}
|
|
209
211
|
});
|
|
210
|
-
const
|
|
211
|
-
function
|
|
212
|
-
return
|
|
213
|
-
|
|
212
|
+
const _e = /* @__PURE__ */ _(ce, [["__scopeId", "data-v-f52e8277"]]), ae = {};
|
|
213
|
+
function le(e, t) {
|
|
214
|
+
return o(), c("li", null, [
|
|
215
|
+
s(e.$slots, "default")
|
|
214
216
|
]);
|
|
215
217
|
}
|
|
216
|
-
const
|
|
218
|
+
const ue = /* @__PURE__ */ _(ae, [["render", le]]), de = ["href", "title"], ie = /* @__PURE__ */ l({
|
|
217
219
|
__name: "Link",
|
|
218
220
|
props: {
|
|
219
221
|
href: {
|
|
@@ -226,53 +228,53 @@ const de = /* @__PURE__ */ _(le, [["render", ue]]), ie = ["href", "title"], fe =
|
|
|
226
228
|
}
|
|
227
229
|
},
|
|
228
230
|
setup(e) {
|
|
229
|
-
return (t, n) => (
|
|
231
|
+
return (t, n) => (o(), c("a", {
|
|
230
232
|
href: e.href,
|
|
231
233
|
rel: "noreferrer noopener nofollow",
|
|
232
234
|
title: e.title
|
|
233
235
|
}, [
|
|
234
|
-
|
|
235
|
-
], 8,
|
|
236
|
+
s(t.$slots, "default", {}, void 0, !0)
|
|
237
|
+
], 8, de));
|
|
236
238
|
}
|
|
237
239
|
});
|
|
238
|
-
const
|
|
240
|
+
const fe = /* @__PURE__ */ _(ie, [["__scopeId", "data-v-9b27e235"]]), pe = {
|
|
239
241
|
blockquote: V,
|
|
240
|
-
code:
|
|
241
|
-
code_block:
|
|
242
|
-
emphasis:
|
|
243
|
-
heading:
|
|
244
|
-
image:
|
|
245
|
-
line_break:
|
|
246
|
-
link:
|
|
247
|
-
list:
|
|
248
|
-
list_item:
|
|
249
|
-
paragraph:
|
|
250
|
-
table:
|
|
251
|
-
table_row:
|
|
252
|
-
table_cell:
|
|
253
|
-
text:
|
|
254
|
-
text_block:
|
|
242
|
+
code: T,
|
|
243
|
+
code_block: P,
|
|
244
|
+
emphasis: E,
|
|
245
|
+
heading: j,
|
|
246
|
+
image: z,
|
|
247
|
+
line_break: G,
|
|
248
|
+
link: fe,
|
|
249
|
+
list: _e,
|
|
250
|
+
list_item: ue,
|
|
251
|
+
paragraph: se,
|
|
252
|
+
table: Q,
|
|
253
|
+
table_row: W,
|
|
254
|
+
table_cell: Y,
|
|
255
|
+
text: R,
|
|
256
|
+
text_block: ne
|
|
255
257
|
}, v = [];
|
|
256
|
-
function
|
|
258
|
+
function me(e) {
|
|
257
259
|
v.indexOf(e) === -1 && (v.push(e), console.warn(`[DocumentViewer] Unable to render an unknown node type "${e}"`));
|
|
258
260
|
}
|
|
259
|
-
function
|
|
261
|
+
function b(e, t) {
|
|
260
262
|
return e.map((n) => {
|
|
261
263
|
if (!n)
|
|
262
264
|
return null;
|
|
263
265
|
const {
|
|
264
|
-
type:
|
|
266
|
+
type: r,
|
|
265
267
|
children: a,
|
|
266
268
|
...g
|
|
267
|
-
} = n, h =
|
|
268
|
-
return h ?
|
|
269
|
+
} = n, h = pe[n.type];
|
|
270
|
+
return h ? $(h, w(g, {
|
|
269
271
|
parent: t
|
|
270
272
|
}), {
|
|
271
|
-
default: () => a &&
|
|
272
|
-
}) : (
|
|
273
|
+
default: () => a && b(a, n)
|
|
274
|
+
}) : (me(r), null);
|
|
273
275
|
});
|
|
274
276
|
}
|
|
275
|
-
const
|
|
277
|
+
const ge = { class: "document-viewer" }, he = /* @__PURE__ */ l({
|
|
276
278
|
__name: "DocumentViewer",
|
|
277
279
|
props: {
|
|
278
280
|
document: {
|
|
@@ -282,18 +284,18 @@ const he = { class: "document-viewer" }, ye = /* @__PURE__ */ l({
|
|
|
282
284
|
},
|
|
283
285
|
setup(e) {
|
|
284
286
|
const t = e, n = () => {
|
|
285
|
-
var
|
|
286
|
-
return (
|
|
287
|
+
var r;
|
|
288
|
+
return (r = t.document) != null && r.children ? b(t.document.children) : null;
|
|
287
289
|
};
|
|
288
|
-
return (
|
|
289
|
-
|
|
290
|
+
return (r, a) => (o(), c("div", ge, [
|
|
291
|
+
$(n)
|
|
290
292
|
]));
|
|
291
293
|
}
|
|
292
294
|
});
|
|
293
|
-
const
|
|
295
|
+
const ve = /* @__PURE__ */ _(he, [["__scopeId", "data-v-4b223d3a"]]);
|
|
294
296
|
export {
|
|
295
297
|
m as TableCellAlign,
|
|
296
298
|
u as TableRowSection,
|
|
297
|
-
|
|
299
|
+
ve as default
|
|
298
300
|
};
|
|
299
301
|
//# sourceMappingURL=document-viewer.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-viewer.es.js","sources":["../src/components/nodes/Blockquote.vue","../src/components/nodes/Code.vue","../src/components/nodes/CodeBlock.vue","../src/components/nodes/Emphasis.vue","../src/components/nodes/Heading.vue","../src/components/nodes/LineBreak.vue","../src/components/nodes/Table.vue","../src/types/index.ts","../src/components/nodes/TableRow.vue","../src/components/nodes/TableCell.vue","../src/components/nodes/Text.vue","../src/components/nodes/TextBlock.vue","../src/components/nodes/Paragraph.vue","../src/components/nodes/List.vue","../src/components/nodes/ListItem.vue","../src/components/renderChildren.tsx","../src/components/DocumentViewer.vue"],"sourcesContent":["<template>\n <blockquote>\n <slot />\n </blockquote>\n</template>\n\n<style scoped>\nblockquote {\n background: var(--document-viewer-blockquote-background, #f8f8fa);\n border-left: 2.5px solid var(--document-viewer-blockquote-border, var(--text_colors-accent, #0b172d));\n border-radius: var(--document-viewer-blockquote-border-radius, 3px);\n font-size: 14px;\n margin: var(--spacing-sm, 12px) var(--spacing-sm, 12px);\n padding: var(--spacing-sm, 12px);\n}\n</style>\n","<template>\n <code>\n <slot />\n </code>\n</template>\n\n<style scoped>\ncode {\n background: var(--document-viewer-code-background, #f1f1f1);\n border-radius: var(--document-viewer-code-border-radius, 3px);\n color: var(--document-viewer-code-color, inherit);\n font-family: var(--document-viewer-code-font-family, var(--document-viewer-font-family-monospace));\n font-size: var(--document-viewer-code-font-size, 14px);\n padding: 12px;\n}\n</style>\n","<template>\n <pre><code><slot /></code></pre>\n</template>\n\n<style scoped>\npre {\n background: var(--document-viewer-code-block-background, #f1f1f1);\n border-radius: var(--document-viewer-code-block-border-radius, 3px);\n color: var(--document-viewer-code-block-color, inherit);\n font-family: var(--document-viewer-code-block-font-family, var(--document-viewer-font-family-monospace));\n font-size: var(--document-viewer-code-block-font-size, 14px);\n padding: 12px;\n}\n</style>\n","<template>\n <component :is=\"tag\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nconst props = defineProps({\n level: {\n type: Number,\n default: 1,\n validator(value: unknown): boolean {\n if (!Number.isInteger(value)) {\n return false\n }\n\n const num = value as number\n return num > 0 && num < 3\n },\n },\n})\n\nconst tag = props.level === 1 ? 'em' : 'strong'\n</script>\n","<template>\n <component :is=\"tag\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nconst props = defineProps({\n level: {\n type: Number,\n validator(value: unknown): boolean {\n if (!Number.isInteger(value)) {\n return false\n }\n\n const num = value as number\n\n return num > 0 && num < 7\n },\n default: 1,\n },\n})\n\nconst tag = `h${props.level}`\n</script>\n\n<style scoped>\nh1, h2, h3, h4, h5, h6 {\n color: var(--document-viewer-color, var(--text_colors-headings, #0b172d));\n font-family: var(--document-viewer-font-family-headings, var(--document-viewer-font-family-default));\n font-weight: var(--document-viewer-heading-font-weight, 500);\n margin-top: 0;\n}\n\nh1 {\n font-size: 32px;\n font-weight: 500;\n line-height: 38px;\n margin-bottom: var(--spacing-xxl, 48px);\n}\n\nh2 {\n font-size: 24px;\n line-height: 20px;\n margin-bottom: var(--spacing-lg, 24px);\n}\n\nh3 {\n font-size: 20px;\n line-height: 20px;\n margin-bottom: var(--spacing-sm, 12px);\n}\n\nh4 {\n font-size: 18px;\n line-height: 20px;\n margin-bottom: var(--spacing-sm, 12px);\n}\n\nh5 {\n font-size: 16px;\n line-height: 20px;\n margin-bottom: var(--spacing-sm, 12px);\n}\n\nh6 {\n font-size: 14.5px;\n line-height: 20px;\n margin-bottom: var(--spacing-sm, 12px);\n}\n\nh1:first-child, h2:first-child, h3:first-child, h4:first-child, h5:first-child, h6:first-child {\n margin-top: 0;\n}\n</style>\n","<template>\n <hr />\n</template>\n","<template>\n <table>\n <slot />\n </table>\n</template>\n","/* eslint-disable no-unused-vars */\nexport interface BaseNode<Type extends string = string> {\n type: Type\n children?: Array<BaseNode>\n}\n\n// TODO: Reach out to DevX for a proper interface\nexport interface Document extends BaseNode<'document'> {\n children: Array<BaseNode>\n version: number\n}\n\nexport enum TableRowSection {\n header = 'header',\n body = 'body',\n footer = 'footer'\n}\n\nexport enum TableCellAlign {\n left = 'left',\n center = 'center',\n right = 'right'\n}\n\nexport interface TableCellNode extends BaseNode<'table_cell'> {\n align?: TableCellAlign\n}\n\nexport interface TableRowNode extends BaseNode<'table_row'> {\n section?: TableRowSection\n children: Array<TableCellNode>\n}\n\nexport interface TextNode extends BaseNode<'text'> {\n text: string\n children: undefined\n hardBreak?: boolean\n}\n\nexport interface HeadingNode extends BaseNode<'heading'> {\n level: number\n}\n\nexport interface ListItemNode extends BaseNode<'list_item'> {}\n\nexport interface ListNode extends BaseNode<'list'> {\n isOrdered?: boolean\n children: Array<ListItemNode>\n}\n\nexport interface LinkNode extends BaseNode<'link'> {\n href: string\n}\n","<template>\n <component :is=\"tag\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { PropType } from 'vue'\nimport { TableRowSection } from '../../types'\n\nconst props = defineProps({\n section: {\n type: String as PropType<TableRowSection>,\n default: TableRowSection.body,\n },\n})\n\nlet tag: string\nif (props.section === TableRowSection.header) {\n tag = 'thead'\n} else if (props.section === TableRowSection.body) {\n tag = 'tbody'\n} else if (props.section === TableRowSection.footer) {\n tag = 'tfoot'\n}\n</script>\n","<template>\n <component\n :is=\"tag\"\n :class=\"className\"\n >\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { PropType } from 'vue'\nimport { TableCellAlign, TableRowNode, TableRowSection } from '../../types'\n\nconst props = defineProps({\n align: {\n type: String as PropType<TableCellAlign>,\n default: TableCellAlign.left,\n },\n parent: {\n type: Object as PropType<TableRowNode>,\n required: true,\n },\n})\n\nconst tag = props.parent?.section === TableRowSection.header ? 'th' : 'td'\n\nlet className: string\nif (props.align === TableCellAlign.center) {\n className = 'align-center'\n} else if (props.align === TableCellAlign.right) {\n className = 'align-right'\n}\n</script>\n\n<style scoped>\nth, td {\n text-align: left;\n}\n\n.align-center {\n text-align: center;\n}\n\n.align-right {\n text-align: right;\n}\n</style>\n","<template>\n {{ text }}\n <br v-if=\"hardBreak\">\n</template>\n\n<script lang=\"ts\">\nexport default {\n inheritAttrs: false,\n}\n</script>\n<script setup lang=\"ts\">\ndefineProps({\n text: {\n type: String,\n required: true,\n },\n hardBreak: {\n type: Boolean,\n default: false,\n },\n})\n</script>\n","<template>\n <template\n v-for=\"node in $slots.default || []\"\n >\n <!-- eslint-disable-next-line vue/valid-v-for -->\n <component :is=\"node\" />\n 
\n </template>\n</template>\n","<template>\n <p>\n <slot />\n </p>\n</template>\n\n<style scoped>\np {\n font-size: 14px;\n line-height: 20px;\n margin: var(--document-viewer-paragraph-margin, 0 0 12px);\n}\n</style>\n","<template>\n <component :is=\"tag\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nconst props = defineProps({\n isOrdered: {\n type: Boolean,\n default: false,\n },\n})\n\nconst tag = props.isOrdered ? 'ol' : 'ul'\n</script>\n\n<style scoped>\nul, ol {\n font-size: 14px;\n margin-bottom: var(--spacing-sm, 12px);\n margin-left: 16px;\n padding: 0;\n}\n\nol {\n list-style: decimal;\n}\n\nul {\n list-style: disc;\n}\n</style>\n","<template>\n <li>\n <slot />\n </li>\n</template>\n","import { Component } from 'vue'\nimport { BaseNode } from '../types'\nimport Blockquote from './nodes/Blockquote.vue'\nimport Code from './nodes/Code.vue'\nimport CodeBlock from './nodes/CodeBlock.vue'\nimport Emphasis from './nodes/Emphasis.vue'\nimport Heading from './nodes/Heading.vue'\nimport Image from './nodes/Image.vue'\nimport LineBreak from './nodes/LineBreak.vue'\nimport Table from './nodes/Table.vue'\nimport TableRow from './nodes/TableRow.vue'\nimport TableCell from './nodes/TableCell.vue'\nimport Text from './nodes/Text.vue'\nimport TextBlock from './nodes/TextBlock.vue'\nimport Paragraph from './nodes/Paragraph.vue'\nimport List from './nodes/List.vue'\nimport ListItem from './nodes/ListItem.vue'\nimport Link from './nodes/Link.vue'\n\n// The node to component mapping is currently static but may change in the future\nconst nodeTypeToComponentMap: Record<string, Component> = {\n blockquote: Blockquote,\n code: Code,\n code_block: CodeBlock,\n emphasis: Emphasis,\n heading: Heading,\n image: Image,\n line_break: LineBreak,\n link: Link,\n list: List,\n list_item: ListItem,\n paragraph: Paragraph,\n table: Table,\n table_row: TableRow,\n table_cell: TableCell,\n text: Text,\n text_block: TextBlock,\n}\n\nconst nodeTypesNotified: Array<string> = []\nfunction notifyUnknownNodeType(type: string) {\n if (nodeTypesNotified.indexOf(type) !== -1) {\n return\n }\n\n nodeTypesNotified.push(type)\n console.warn(`[DocumentViewer] Unable to render an unknown node type \"${type}\"`)\n}\n\nexport default function renderChildren<ChildTypes extends BaseNode>(children: Array<ChildTypes>, parent?: BaseNode): Component {\n return children.map((child) => {\n if (!child) {\n return null\n }\n\n const { type, children, ...restProps } = child\n const component = nodeTypeToComponentMap[child.type]\n\n if (!component) {\n notifyUnknownNodeType(child.type)\n return null\n }\n\n return (\n <component {...restProps} parent={parent}>\n {() => children && renderChildren(children, child)}\n </component>\n )\n })\n}\n","<template>\n <div class=\"document-viewer\">\n <Children />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport renderChildren from './renderChildren'\n\nconst props = defineProps({\n document: {\n type: Object,\n required: true,\n },\n})\n\nconst Children = () => props.document?.children ? renderChildren(props.document.children) : null\n</script>\n\n<style>\n:root {\n --document-viewer-font-family-default: Roboto, Helvetica, sans-serif;\n --document-viewer-font-family-monospace: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\n}\n</style>\n<style scoped>\n.document-viewer {\n color: var(--document-viewer-color, var(--text_colors-primary, #0b172d));\n font-family: var(--document-viewer-font-family-default, var(--font-family-sans));\n font-size: var(--document-viewer-font-size, 16px);\n}\n</style>\n"],"names":["_cache","_openBlock","_createElementBlock","tag","TableRowSection","TableCellAlign","props","_a","className","__default__","_sfc_render","_ctx","_renderList","node","nodeTypeToComponentMap","blockquote","Blockquote","code","Code","code_block","CodeBlock","emphasis","Emphasis","heading","Heading","image","Image","line_break","LineBreak","link","Link","list","List","list_item","ListItem","paragraph","Paragraph","table","Table","table_row","TableRow","table_cell","TableCell","text","Text","text_block","TextBlock","nodeTypesNotified","notifyUnknownNodeType","type","indexOf","push","console","warn","renderChildren","children","parent","map","child","restProps","component","_createVNode","_mergeProps","Children"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"document-viewer.es.js","sources":["../src/components/nodes/Blockquote.vue","../src/components/nodes/Code.vue","../src/components/nodes/CodeBlock.vue","../src/components/nodes/Emphasis.vue","../src/components/nodes/Heading.vue","../src/components/nodes/LineBreak.vue","../src/components/nodes/Table.vue","../src/types/index.ts","../src/components/nodes/TableRow.vue","../src/components/nodes/TableCell.vue","../src/components/nodes/Text.vue","../src/components/nodes/TextBlock.vue","../src/components/nodes/Paragraph.vue","../src/components/nodes/List.vue","../src/components/nodes/ListItem.vue","../src/components/renderChildren.tsx","../src/components/DocumentViewer.vue"],"sourcesContent":["<template>\n <blockquote>\n <slot />\n </blockquote>\n</template>\n\n<style scoped>\nblockquote {\n background: var(--document-viewer-blockquote-background, #f8f8fa);\n border-left: 2.5px solid var(--document-viewer-blockquote-border, var(--text_colors-accent, #0b172d));\n border-radius: var(--document-viewer-blockquote-border-radius, 3px);\n font-size: 14px;\n margin: var(--spacing-sm, 12px) var(--spacing-sm, 12px);\n padding: var(--spacing-sm, 12px);\n}\n</style>\n","<template>\n <code>\n <slot />\n </code>\n</template>\n\n<style scoped>\ncode {\n background: var(--document-viewer-code-background, #f1f1f1);\n border-radius: var(--document-viewer-code-border-radius, 3px);\n color: var(--document-viewer-code-color, inherit);\n font-family: var(--document-viewer-code-font-family, var(--document-viewer-font-family-monospace));\n font-size: var(--document-viewer-code-font-size, 14px);\n padding: 4px 6px;\n}\n</style>\n","<template>\n <pre><code><slot /></code></pre>\n</template>\n\n<style scoped>\npre {\n background: var(--document-viewer-code-block-background, #f1f1f1);\n border-radius: var(--document-viewer-code-block-border-radius, 3px);\n color: var(--document-viewer-code-block-color, inherit);\n font-family: var(--document-viewer-code-block-font-family, var(--document-viewer-font-family-monospace));\n font-size: var(--document-viewer-code-block-font-size, 14px);\n margin-bottom: var(--spacing-sm, 12px);\n padding: 12px;\n}\n</style>\n","<template>\n <component :is=\"tag\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nconst props = defineProps({\n level: {\n type: Number,\n default: 1,\n validator(value: unknown): boolean {\n if (!Number.isInteger(value)) {\n return false\n }\n\n const num = value as number\n return num > 0 && num < 3\n },\n },\n})\n\nconst tag = props.level === 1 ? 'em' : 'strong'\n</script>\n","<template>\n <component :is=\"tag\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nconst props = defineProps({\n level: {\n type: Number,\n validator(value: unknown): boolean {\n if (!Number.isInteger(value)) {\n return false\n }\n\n const num = value as number\n\n return num > 0 && num < 7\n },\n default: 1,\n },\n})\n\nconst tag = `h${props.level}`\n</script>\n\n<style scoped>\nh1, h2, h3, h4, h5, h6 {\n color: var(--document-viewer-color, var(--text_colors-headings, #0b172d));\n font-family: var(--document-viewer-font-family-headings, var(--document-viewer-font-family-default));\n font-weight: var(--document-viewer-heading-font-weight, 500);\n margin-top: 0;\n}\n\nh1 {\n font-size: 32px;\n font-weight: 500;\n line-height: 38px;\n margin-bottom: var(--spacing-xxl, 48px);\n}\n\nh2 {\n font-size: 24px;\n line-height: 20px;\n margin-bottom: var(--spacing-lg, 24px);\n}\n\nh3 {\n font-size: 20px;\n line-height: 20px;\n margin-bottom: var(--spacing-sm, 12px);\n}\n\nh4 {\n font-size: 18px;\n line-height: 20px;\n margin-bottom: var(--spacing-sm, 12px);\n}\n\nh5 {\n font-size: 16px;\n line-height: 20px;\n margin-bottom: var(--spacing-sm, 12px);\n}\n\nh6 {\n font-size: 14.5px;\n line-height: 20px;\n margin-bottom: var(--spacing-sm, 12px);\n}\n\nh1:first-child, h2:first-child, h3:first-child, h4:first-child, h5:first-child, h6:first-child {\n margin-top: 0;\n}\n</style>\n","<template>\n <hr />\n</template>\n","<template>\n <table>\n <slot />\n </table>\n</template>\n","/* eslint-disable no-unused-vars */\nexport interface BaseNode<Type extends string = string> {\n type: Type\n children?: Array<BaseNode>\n}\n\n// TODO: Reach out to DevX for a proper interface\nexport interface Document extends BaseNode<'document'> {\n children: Array<BaseNode>\n version: number\n}\n\nexport enum TableRowSection {\n header = 'header',\n body = 'body',\n footer = 'footer'\n}\n\nexport enum TableCellAlign {\n left = 'left',\n center = 'center',\n right = 'right'\n}\n\nexport interface TableCellNode extends BaseNode<'table_cell'> {\n align?: TableCellAlign\n}\n\nexport interface TableRowNode extends BaseNode<'table_row'> {\n section?: TableRowSection\n children: Array<TableCellNode>\n}\n\nexport interface TextNode extends BaseNode<'text'> {\n text: string\n children: undefined\n hardBreak?: boolean\n}\n\nexport interface HeadingNode extends BaseNode<'heading'> {\n level: number\n}\n\nexport interface ListItemNode extends BaseNode<'list_item'> {}\n\nexport interface ListNode extends BaseNode<'list'> {\n isOrdered?: boolean\n children: Array<ListItemNode>\n}\n\nexport interface LinkNode extends BaseNode<'link'> {\n href: string\n}\n","<template>\n <component :is=\"tag\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { PropType } from 'vue'\nimport { TableRowSection } from '../../types'\n\nconst props = defineProps({\n section: {\n type: String as PropType<TableRowSection>,\n default: TableRowSection.body,\n },\n})\n\nlet tag: string\nif (props.section === TableRowSection.header) {\n tag = 'thead'\n} else if (props.section === TableRowSection.body) {\n tag = 'tbody'\n} else if (props.section === TableRowSection.footer) {\n tag = 'tfoot'\n}\n</script>\n","<template>\n <component\n :is=\"tag\"\n :class=\"className\"\n >\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { PropType } from 'vue'\nimport { TableCellAlign, TableRowNode, TableRowSection } from '../../types'\n\nconst props = defineProps({\n align: {\n type: String as PropType<TableCellAlign>,\n default: TableCellAlign.left,\n },\n parent: {\n type: Object as PropType<TableRowNode>,\n required: true,\n },\n})\n\nconst tag = props.parent?.section === TableRowSection.header ? 'th' : 'td'\n\nlet className: string\nif (props.align === TableCellAlign.center) {\n className = 'align-center'\n} else if (props.align === TableCellAlign.right) {\n className = 'align-right'\n}\n</script>\n\n<style scoped>\nth, td {\n text-align: left;\n}\n\n.align-center {\n text-align: center;\n}\n\n.align-right {\n text-align: right;\n}\n</style>\n","<template>\n {{ text }}<br v-if=\"hardBreak\">\n</template>\n\n<script lang=\"ts\">\nexport default {\n inheritAttrs: false,\n}\n</script>\n<script setup lang=\"ts\">\ndefineProps({\n text: {\n type: String,\n required: true,\n },\n hardBreak: {\n type: Boolean,\n default: false,\n },\n})\n</script>\n","<template>\n <span>\n <slot />\n </span>\n</template>\n","<template>\n <p>\n <slot />\n </p>\n</template>\n\n<style scoped>\np {\n font-size: 14px;\n line-height: 20px;\n margin: var(--document-viewer-paragraph-margin, 0 0 12px);\n}\n</style>\n","<template>\n <component :is=\"tag\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nconst props = defineProps({\n isOrdered: {\n type: Boolean,\n default: false,\n },\n})\n\nconst tag = props.isOrdered ? 'ol' : 'ul'\n</script>\n\n<style scoped>\nul, ol {\n font-size: 14px;\n margin-bottom: var(--spacing-sm, 12px);\n margin-left: 16px;\n padding: 0;\n}\n\nol {\n list-style: decimal;\n}\n\nul {\n list-style: disc;\n}\n</style>\n","<template>\n <li>\n <slot />\n </li>\n</template>\n","import { Component } from 'vue'\nimport { BaseNode } from '../types'\nimport Blockquote from './nodes/Blockquote.vue'\nimport Code from './nodes/Code.vue'\nimport CodeBlock from './nodes/CodeBlock.vue'\nimport Emphasis from './nodes/Emphasis.vue'\nimport Heading from './nodes/Heading.vue'\nimport Image from './nodes/Image.vue'\nimport LineBreak from './nodes/LineBreak.vue'\nimport Table from './nodes/Table.vue'\nimport TableRow from './nodes/TableRow.vue'\nimport TableCell from './nodes/TableCell.vue'\nimport Text from './nodes/Text.vue'\nimport TextBlock from './nodes/TextBlock.vue'\nimport Paragraph from './nodes/Paragraph.vue'\nimport List from './nodes/List.vue'\nimport ListItem from './nodes/ListItem.vue'\nimport Link from './nodes/Link.vue'\n\n// The node to component mapping is currently static but may change in the future\nconst nodeTypeToComponentMap: Record<string, Component> = {\n blockquote: Blockquote,\n code: Code,\n code_block: CodeBlock,\n emphasis: Emphasis,\n heading: Heading,\n image: Image,\n line_break: LineBreak,\n link: Link,\n list: List,\n list_item: ListItem,\n paragraph: Paragraph,\n table: Table,\n table_row: TableRow,\n table_cell: TableCell,\n text: Text,\n text_block: TextBlock,\n}\n\nconst nodeTypesNotified: Array<string> = []\nfunction notifyUnknownNodeType(type: string) {\n if (nodeTypesNotified.indexOf(type) !== -1) {\n return\n }\n\n nodeTypesNotified.push(type)\n console.warn(`[DocumentViewer] Unable to render an unknown node type \"${type}\"`)\n}\n\nexport default function renderChildren<ChildTypes extends BaseNode>(children: Array<ChildTypes>, parent?: BaseNode): Component {\n return children.map((child) => {\n if (!child) {\n return null\n }\n\n const { type, children, ...restProps } = child\n const component = nodeTypeToComponentMap[child.type]\n\n if (!component) {\n notifyUnknownNodeType(type)\n return null\n }\n\n return (\n <component {...restProps} parent={parent}>\n {() => children && renderChildren(children, child)}\n </component>\n )\n })\n}\n","<template>\n <div class=\"document-viewer\">\n <Children />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport renderChildren from './renderChildren'\n\nconst props = defineProps({\n document: {\n type: Object,\n required: true,\n },\n})\n\nconst Children = () => props.document?.children ? renderChildren(props.document.children) : null\n</script>\n\n<style>\n:root {\n --document-viewer-font-family-default: Roboto, Helvetica, sans-serif;\n --document-viewer-font-family-monospace: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\n}\n</style>\n<style scoped>\n.document-viewer {\n color: var(--document-viewer-color, var(--text_colors-primary, #0b172d));\n font-family: var(--document-viewer-font-family-default, var(--font-family-sans));\n font-size: var(--document-viewer-font-size, 16px);\n}\n</style>\n"],"names":["_cache","_openBlock","_createElementBlock","tag","TableRowSection","TableCellAlign","props","_a","className","__default__","nodeTypeToComponentMap","blockquote","Blockquote","code","Code","code_block","CodeBlock","emphasis","Emphasis","heading","Heading","image","Image","line_break","LineBreak","link","Link","list","List","list_item","ListItem","paragraph","Paragraph","table","Table","table_row","TableRow","table_cell","TableCell","text","Text","text_block","TextBlock","nodeTypesNotified","notifyUnknownNodeType","type","indexOf","push","console","warn","renderChildren","children","parent","map","child","restProps","component","_createVNode","_mergeProps","Children"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(s,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(s=typeof globalThis<"u"?globalThis:s||self,e(s["kong-ui-public-document-viewer"]={},s.Vue))})(this,function(s,e){"use strict";const re="",c=(t,n)=>{const o=t.__vccOpts||t;for(const[r,l]of n)o[r]=l;return o},u={};function m(t,n){return e.openBlock(),e.createElementBlock("blockquote",null,[e.renderSlot(t.$slots,"default",{},void 0,!0)])}const k=c(u,[["render",m],["__scopeId","data-v-a9ac327a"]]),ce="",
|
|
1
|
+
(function(s,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(s=typeof globalThis<"u"?globalThis:s||self,e(s["kong-ui-public-document-viewer"]={},s.Vue))})(this,function(s,e){"use strict";const re="",c=(t,n)=>{const o=t.__vccOpts||t;for(const[r,l]of n)o[r]=l;return o},u={};function m(t,n){return e.openBlock(),e.createElementBlock("blockquote",null,[e.renderSlot(t.$slots,"default",{},void 0,!0)])}const k=c(u,[["render",m],["__scopeId","data-v-a9ac327a"]]),ce="",h={};function y(t,n){return e.openBlock(),e.createElementBlock("code",null,[e.renderSlot(t.$slots,"default",{},void 0,!0)])}const g=c(h,[["render",y],["__scopeId","data-v-015a6bbb"]]),le="",B={};function $(t,n){return e.openBlock(),e.createElementBlock("pre",null,[e.createElementVNode("code",null,[e.renderSlot(t.$slots,"default",{},void 0,!0)])])}const b=c(B,[["render",$],["__scopeId","data-v-7d7d103e"]]),C=e.defineComponent({__name:"Emphasis",props:{level:{type:Number,default:1,validator(t){if(!Number.isInteger(t))return!1;const n=t;return n>0&&n<3}}},setup(t){const o=t.level===1?"em":"strong";return(r,l)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(o)),null,{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3}))}}),x=e.defineComponent({__name:"Heading",props:{level:{type:Number,validator(t){if(!Number.isInteger(t))return!1;const n=t;return n>0&&n<7},default:1}},setup(t){const o=`h${t.level}`;return(r,l)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o),null,{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default",{},void 0,!0)]),_:3}))}}),se="",S=c(x,[["__scopeId","data-v-07152ca1"]]),w=["alt","src","title"],E=e.defineComponent({__name:"Image",props:{url:{type:String,required:!0},alt:{type:String,default:""},title:{type:String,default:""}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("figure",null,[e.createElementVNode("img",{alt:t.alt,src:t.url,title:t.title},null,8,w),e.createElementVNode("figcaption",null,[e.renderSlot(n.$slots,"default")])]))}}),N={};function I(t,n){return e.openBlock(),e.createElementBlock("hr")}const T=c(N,[["render",I]]),V={};function D(t,n){return e.openBlock(),e.createElementBlock("table",null,[e.renderSlot(t.$slots,"default")])}const q=c(V,[["render",D]]);var a=(t=>(t.header="header",t.body="body",t.footer="footer",t))(a||{}),_=(t=>(t.left="left",t.center="center",t.right="right",t))(_||{});const L=e.defineComponent({__name:"TableRow",props:{section:{type:String,default:a.body}},setup(t){const n=t;let o;return n.section===a.header?o="thead":n.section===a.body?o="tbody":n.section===a.footer&&(o="tfoot"),(r,l)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(o)),null,{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3}))}}),O=e.defineComponent({__name:"TableCell",props:{align:{type:String,default:_.left},parent:{type:Object,required:!0}},setup(t){var l;const n=t,o=((l=n.parent)==null?void 0:l.section)===a.header?"th":"td";let r;return n.align===_.center?r="align-center":n.align===_.right&&(r="align-right"),(d,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(o)),{class:e.normalizeClass(e.unref(r))},{default:e.withCtx(()=>[e.renderSlot(d.$slots,"default",{},void 0,!0)]),_:3},8,["class"]))}}),ae="",P=c(O,[["__scopeId","data-v-6da63f53"]]),j={key:0},H={inheritAttrs:!1},M=e.defineComponent({...H,__name:"Text",props:{text:{type:String,required:!0},hardBreak:{type:Boolean,default:!1}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createTextVNode(e.toDisplayString(t.text),1),t.hardBreak?(e.openBlock(),e.createElementBlock("br",j)):e.createCommentVNode("",!0)],64))}}),U={};function z(t,n){return e.openBlock(),e.createElementBlock("span",null,[e.renderSlot(t.$slots,"default")])}const F=c(U,[["render",z]]),_e="",A={};function G(t,n){return e.openBlock(),e.createElementBlock("p",null,[e.renderSlot(t.$slots,"default",{},void 0,!0)])}const J=c(A,[["render",G],["__scopeId","data-v-c7681718"]]),K=e.defineComponent({__name:"List",props:{isOrdered:{type:Boolean,default:!1}},setup(t){const o=t.isOrdered?"ol":"ul";return(r,l)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(o)),null,{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default",{},void 0,!0)]),_:3}))}}),de="",Q=c(K,[["__scopeId","data-v-f52e8277"]]),R={};function W(t,n){return e.openBlock(),e.createElementBlock("li",null,[e.renderSlot(t.$slots,"default")])}const X=c(R,[["render",W]]),Y=["href","title"],Z=e.defineComponent({__name:"Link",props:{href:{type:String,required:!0},title:{type:String,default:""}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("a",{href:t.href,rel:"noreferrer noopener nofollow",title:t.title},[e.renderSlot(n.$slots,"default",{},void 0,!0)],8,Y))}}),ie="",v={blockquote:k,code:g,code_block:b,emphasis:C,heading:S,image:E,line_break:T,link:c(Z,[["__scopeId","data-v-9b27e235"]]),list:Q,list_item:X,paragraph:J,table:q,table_row:L,table_cell:P,text:M,text_block:F},p=[];function ee(t){p.indexOf(t)===-1&&(p.push(t),console.warn(`[DocumentViewer] Unable to render an unknown node type "${t}"`))}function f(t,n){return t.map(o=>{if(!o)return null;const{type:r,children:l,...d}=o,i=v[o.type];return i?e.createVNode(i,e.mergeProps(d,{parent:n}),{default:()=>l&&f(l,o)}):(ee(r),null)})}const te={class:"document-viewer"},ne=e.defineComponent({__name:"DocumentViewer",props:{document:{type:Object,required:!0}},setup(t){const n=t,o=()=>{var r;return(r=n.document)!=null&&r.children?f(n.document.children):null};return(r,l)=>(e.openBlock(),e.createElementBlock("div",te,[e.createVNode(o)]))}}),fe="",ue="",oe=c(ne,[["__scopeId","data-v-4b223d3a"]]);s.TableCellAlign=_,s.TableRowSection=a,s.default=oe,Object.defineProperties(s,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
2
2
|
//# sourceMappingURL=document-viewer.umd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-viewer.umd.js","sources":["../src/components/nodes/Blockquote.vue","../src/components/nodes/Code.vue","../src/components/nodes/CodeBlock.vue","../src/components/nodes/Emphasis.vue","../src/components/nodes/Heading.vue","../src/components/nodes/LineBreak.vue","../src/components/nodes/Table.vue","../src/types/index.ts","../src/components/nodes/TableRow.vue","../src/components/nodes/TableCell.vue","../src/components/nodes/Text.vue","../src/components/nodes/TextBlock.vue","../src/components/nodes/Paragraph.vue","../src/components/nodes/List.vue","../src/components/nodes/ListItem.vue","../src/components/renderChildren.tsx","../src/components/DocumentViewer.vue"],"sourcesContent":["<template>\n <blockquote>\n <slot />\n </blockquote>\n</template>\n\n<style scoped>\nblockquote {\n background: var(--document-viewer-blockquote-background, #f8f8fa);\n border-left: 2.5px solid var(--document-viewer-blockquote-border, var(--text_colors-accent, #0b172d));\n border-radius: var(--document-viewer-blockquote-border-radius, 3px);\n font-size: 14px;\n margin: var(--spacing-sm, 12px) var(--spacing-sm, 12px);\n padding: var(--spacing-sm, 12px);\n}\n</style>\n","<template>\n <code>\n <slot />\n </code>\n</template>\n\n<style scoped>\ncode {\n background: var(--document-viewer-code-background, #f1f1f1);\n border-radius: var(--document-viewer-code-border-radius, 3px);\n color: var(--document-viewer-code-color, inherit);\n font-family: var(--document-viewer-code-font-family, var(--document-viewer-font-family-monospace));\n font-size: var(--document-viewer-code-font-size, 14px);\n padding: 12px;\n}\n</style>\n","<template>\n <pre><code><slot /></code></pre>\n</template>\n\n<style scoped>\npre {\n background: var(--document-viewer-code-block-background, #f1f1f1);\n border-radius: var(--document-viewer-code-block-border-radius, 3px);\n color: var(--document-viewer-code-block-color, inherit);\n font-family: var(--document-viewer-code-block-font-family, var(--document-viewer-font-family-monospace));\n font-size: var(--document-viewer-code-block-font-size, 14px);\n padding: 12px;\n}\n</style>\n","<template>\n <component :is=\"tag\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nconst props = defineProps({\n level: {\n type: Number,\n default: 1,\n validator(value: unknown): boolean {\n if (!Number.isInteger(value)) {\n return false\n }\n\n const num = value as number\n return num > 0 && num < 3\n },\n },\n})\n\nconst tag = props.level === 1 ? 'em' : 'strong'\n</script>\n","<template>\n <component :is=\"tag\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nconst props = defineProps({\n level: {\n type: Number,\n validator(value: unknown): boolean {\n if (!Number.isInteger(value)) {\n return false\n }\n\n const num = value as number\n\n return num > 0 && num < 7\n },\n default: 1,\n },\n})\n\nconst tag = `h${props.level}`\n</script>\n\n<style scoped>\nh1, h2, h3, h4, h5, h6 {\n color: var(--document-viewer-color, var(--text_colors-headings, #0b172d));\n font-family: var(--document-viewer-font-family-headings, var(--document-viewer-font-family-default));\n font-weight: var(--document-viewer-heading-font-weight, 500);\n margin-top: 0;\n}\n\nh1 {\n font-size: 32px;\n font-weight: 500;\n line-height: 38px;\n margin-bottom: var(--spacing-xxl, 48px);\n}\n\nh2 {\n font-size: 24px;\n line-height: 20px;\n margin-bottom: var(--spacing-lg, 24px);\n}\n\nh3 {\n font-size: 20px;\n line-height: 20px;\n margin-bottom: var(--spacing-sm, 12px);\n}\n\nh4 {\n font-size: 18px;\n line-height: 20px;\n margin-bottom: var(--spacing-sm, 12px);\n}\n\nh5 {\n font-size: 16px;\n line-height: 20px;\n margin-bottom: var(--spacing-sm, 12px);\n}\n\nh6 {\n font-size: 14.5px;\n line-height: 20px;\n margin-bottom: var(--spacing-sm, 12px);\n}\n\nh1:first-child, h2:first-child, h3:first-child, h4:first-child, h5:first-child, h6:first-child {\n margin-top: 0;\n}\n</style>\n","<template>\n <hr />\n</template>\n","<template>\n <table>\n <slot />\n </table>\n</template>\n","/* eslint-disable no-unused-vars */\nexport interface BaseNode<Type extends string = string> {\n type: Type\n children?: Array<BaseNode>\n}\n\n// TODO: Reach out to DevX for a proper interface\nexport interface Document extends BaseNode<'document'> {\n children: Array<BaseNode>\n version: number\n}\n\nexport enum TableRowSection {\n header = 'header',\n body = 'body',\n footer = 'footer'\n}\n\nexport enum TableCellAlign {\n left = 'left',\n center = 'center',\n right = 'right'\n}\n\nexport interface TableCellNode extends BaseNode<'table_cell'> {\n align?: TableCellAlign\n}\n\nexport interface TableRowNode extends BaseNode<'table_row'> {\n section?: TableRowSection\n children: Array<TableCellNode>\n}\n\nexport interface TextNode extends BaseNode<'text'> {\n text: string\n children: undefined\n hardBreak?: boolean\n}\n\nexport interface HeadingNode extends BaseNode<'heading'> {\n level: number\n}\n\nexport interface ListItemNode extends BaseNode<'list_item'> {}\n\nexport interface ListNode extends BaseNode<'list'> {\n isOrdered?: boolean\n children: Array<ListItemNode>\n}\n\nexport interface LinkNode extends BaseNode<'link'> {\n href: string\n}\n","<template>\n <component :is=\"tag\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { PropType } from 'vue'\nimport { TableRowSection } from '../../types'\n\nconst props = defineProps({\n section: {\n type: String as PropType<TableRowSection>,\n default: TableRowSection.body,\n },\n})\n\nlet tag: string\nif (props.section === TableRowSection.header) {\n tag = 'thead'\n} else if (props.section === TableRowSection.body) {\n tag = 'tbody'\n} else if (props.section === TableRowSection.footer) {\n tag = 'tfoot'\n}\n</script>\n","<template>\n <component\n :is=\"tag\"\n :class=\"className\"\n >\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { PropType } from 'vue'\nimport { TableCellAlign, TableRowNode, TableRowSection } from '../../types'\n\nconst props = defineProps({\n align: {\n type: String as PropType<TableCellAlign>,\n default: TableCellAlign.left,\n },\n parent: {\n type: Object as PropType<TableRowNode>,\n required: true,\n },\n})\n\nconst tag = props.parent?.section === TableRowSection.header ? 'th' : 'td'\n\nlet className: string\nif (props.align === TableCellAlign.center) {\n className = 'align-center'\n} else if (props.align === TableCellAlign.right) {\n className = 'align-right'\n}\n</script>\n\n<style scoped>\nth, td {\n text-align: left;\n}\n\n.align-center {\n text-align: center;\n}\n\n.align-right {\n text-align: right;\n}\n</style>\n","<template>\n {{ text }}\n <br v-if=\"hardBreak\">\n</template>\n\n<script lang=\"ts\">\nexport default {\n inheritAttrs: false,\n}\n</script>\n<script setup lang=\"ts\">\ndefineProps({\n text: {\n type: String,\n required: true,\n },\n hardBreak: {\n type: Boolean,\n default: false,\n },\n})\n</script>\n","<template>\n <template\n v-for=\"node in $slots.default || []\"\n >\n <!-- eslint-disable-next-line vue/valid-v-for -->\n <component :is=\"node\" />\n 
\n </template>\n</template>\n","<template>\n <p>\n <slot />\n </p>\n</template>\n\n<style scoped>\np {\n font-size: 14px;\n line-height: 20px;\n margin: var(--document-viewer-paragraph-margin, 0 0 12px);\n}\n</style>\n","<template>\n <component :is=\"tag\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nconst props = defineProps({\n isOrdered: {\n type: Boolean,\n default: false,\n },\n})\n\nconst tag = props.isOrdered ? 'ol' : 'ul'\n</script>\n\n<style scoped>\nul, ol {\n font-size: 14px;\n margin-bottom: var(--spacing-sm, 12px);\n margin-left: 16px;\n padding: 0;\n}\n\nol {\n list-style: decimal;\n}\n\nul {\n list-style: disc;\n}\n</style>\n","<template>\n <li>\n <slot />\n </li>\n</template>\n","import { Component } from 'vue'\nimport { BaseNode } from '../types'\nimport Blockquote from './nodes/Blockquote.vue'\nimport Code from './nodes/Code.vue'\nimport CodeBlock from './nodes/CodeBlock.vue'\nimport Emphasis from './nodes/Emphasis.vue'\nimport Heading from './nodes/Heading.vue'\nimport Image from './nodes/Image.vue'\nimport LineBreak from './nodes/LineBreak.vue'\nimport Table from './nodes/Table.vue'\nimport TableRow from './nodes/TableRow.vue'\nimport TableCell from './nodes/TableCell.vue'\nimport Text from './nodes/Text.vue'\nimport TextBlock from './nodes/TextBlock.vue'\nimport Paragraph from './nodes/Paragraph.vue'\nimport List from './nodes/List.vue'\nimport ListItem from './nodes/ListItem.vue'\nimport Link from './nodes/Link.vue'\n\n// The node to component mapping is currently static but may change in the future\nconst nodeTypeToComponentMap: Record<string, Component> = {\n blockquote: Blockquote,\n code: Code,\n code_block: CodeBlock,\n emphasis: Emphasis,\n heading: Heading,\n image: Image,\n line_break: LineBreak,\n link: Link,\n list: List,\n list_item: ListItem,\n paragraph: Paragraph,\n table: Table,\n table_row: TableRow,\n table_cell: TableCell,\n text: Text,\n text_block: TextBlock,\n}\n\nconst nodeTypesNotified: Array<string> = []\nfunction notifyUnknownNodeType(type: string) {\n if (nodeTypesNotified.indexOf(type) !== -1) {\n return\n }\n\n nodeTypesNotified.push(type)\n console.warn(`[DocumentViewer] Unable to render an unknown node type \"${type}\"`)\n}\n\nexport default function renderChildren<ChildTypes extends BaseNode>(children: Array<ChildTypes>, parent?: BaseNode): Component {\n return children.map((child) => {\n if (!child) {\n return null\n }\n\n const { type, children, ...restProps } = child\n const component = nodeTypeToComponentMap[child.type]\n\n if (!component) {\n notifyUnknownNodeType(child.type)\n return null\n }\n\n return (\n <component {...restProps} parent={parent}>\n {() => children && renderChildren(children, child)}\n </component>\n )\n })\n}\n","<template>\n <div class=\"document-viewer\">\n <Children />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport renderChildren from './renderChildren'\n\nconst props = defineProps({\n document: {\n type: Object,\n required: true,\n },\n})\n\nconst Children = () => props.document?.children ? renderChildren(props.document.children) : null\n</script>\n\n<style>\n:root {\n --document-viewer-font-family-default: Roboto, Helvetica, sans-serif;\n --document-viewer-font-family-monospace: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\n}\n</style>\n<style scoped>\n.document-viewer {\n color: var(--document-viewer-color, var(--text_colors-primary, #0b172d));\n font-family: var(--document-viewer-font-family-default, var(--font-family-sans));\n font-size: var(--document-viewer-font-size, 16px);\n}\n</style>\n"],"names":["_cache","_openBlock","_createElementBlock","tag","TableRowSection","TableCellAlign","props","_a","className","__default__","_sfc_render","_ctx","_renderList","node","nodeTypeToComponentMap","blockquote","Blockquote","code","Code","code_block","CodeBlock","emphasis","Emphasis","heading","Heading","image","Image","line_break","LineBreak","link","list","List","list_item","ListItem","paragraph","Paragraph","table","Table","table_row","TableRow","table_cell","TableCell","text","Text","text_block","TextBlock","nodeTypesNotified","notifyUnknownNodeType","type","indexOf","push","console","warn","renderChildren","children","parent","map","child","restProps","component","_createVNode","_mergeProps","Children"],"mappings":"yXAGeA,EAAA,QADHC,YAAA,EAAAC,qBAAA,aAAA,KAAA,qICCHF,EAAA,QADGC,YAAA,EAAAC,qBAAA,OAAA,KAAA,qICDsBF,EAAA,QAANC,YAAA,EAAAC,qBAAA,MAAA,KAAA,GAAP,mBAAA,OAAA,KAAA,8QCqBrB,MAAMC,IAAY,QAAU,EAAI,KAAO,iUCCjC,MAAAA,EAAM,MAAU,wmBCtBdH,EAAA,+FCEEA,EAAA,QADEC,YAAA,EAAAC,qBAAA,QAAA,KAAA,gECUA,IAAAE,GAAAA,IACVA,EAAA,OAAS,SACTA,EAAA,KAAO,OACPA,EAAA,OAAS,SAHCA,IAAAA,GAAA,CAAA,CAAA,EAMAC,GAAAA,IACVA,EAAA,KAAO,OACPA,EAAA,OAAS,SACTA,EAAA,MAAQ,QAHEA,IAAAA,GAAA,CAAA,CAAA,+GCDR,IAAAF,EACA,OAAAG,EAAM,UAAYF,EAAgB,OAC9BD,EAAA,QACGG,EAAM,UAAYF,EAAgB,KACrCD,EAAA,QACGG,EAAM,UAAYF,EAAgB,SACrCD,EAAA,0SCCFA,IAAMI,EAAAD,EAAM,SAAN,YAAAC,EAAc,WAAYH,EAAgB,OAAS,KAAO,KAElE,IAAAI,EACA,OAAAF,EAAM,QAAUD,EAAe,OACrBG,EAAA,eACHF,EAAM,QAAUD,EAAe,QAC5BG,EAAA,qRCxBdC,EAAe,CACb,aAAc,EAChB,sVCPE,SAAAC,EAAAC,EAAAX,EAAA,CAIE,OAAAC,EAAA,UAAA,EAAA,EAAAC,qCAAoBU,aAAAD,EAAA,OAAA,SAAA,CAAA,EAAAE,yHCFlBb,EAAA,QADMC,YAAA,EAAAC,qBAAA,IAAA,KAAA,qMCYN,MAAAC,IAAY,UAAY,KAAO,6OCX9BH,EAAA,QADKC,YAAA,EAAAC,qBAAA,KAAA,KAAA,wXCkBNY,EAAoD,CACxDC,WAAYC,EACZC,KAAMC,EACNC,WAAYC,EACZC,SAAUC,EACVC,QAASC,EACTC,MAAOC,EACPC,WAAYC,EACZC,4CACAC,KAAMC,EACNC,UAAWC,EACXC,UAAWC,EACXC,MAAOC,EACPC,UAAWC,EACXC,WAAYC,EACZC,KAAMC,EACNC,WAAYC,CACd,EAEMC,EAAmC,CAAA,EACzC,SAASC,GAAsBC,EAAc,CACvCF,EAAkBG,QAAQD,CAAI,IAAM,KAIxCF,EAAkBI,KAAKF,CAAI,EAC3BG,QAAQC,KAAM,2DAA0DJ,IAAO,EACjF,CAEe,SAASK,EAA4CC,EAA6BC,EAA8B,CAC7H,OAAOD,EAASE,IAAKC,GAAU,CAC7B,GAAI,CAACA,EACH,OAAO,KAGT,KAAM,CAAET,KAAAA,EAAMM,SAAAA,EAAU,GAAGI,CAAW,EAAGD,EACnCE,EAAY7C,EAAuB2C,EAAMT,IAAI,EAEnD,OAAKW,EAKLC,cAAAD,EAAAE,EAAA,WACiBH,EAAS,CAAA,OAAUH,CAAM,CAAA,EAAA,CAAA,QACrC,IAAMD,GAAYD,EAAeC,EAAUG,CAAK,CAAC,CAAA,GANpDV,GAAsBU,EAAMT,IAAI,EACzB,KAQX,CAAC,CACH,gJCrDMc,EAAW,IAAA,OAAM,OAAAvD,EAAAD,EAAM,WAAN,MAAAC,EAAgB,SAAW8C,EAAe/C,EAAM,SAAS,QAAQ,EAAI"}
|
|
1
|
+
{"version":3,"file":"document-viewer.umd.js","sources":["../src/components/nodes/Blockquote.vue","../src/components/nodes/Code.vue","../src/components/nodes/CodeBlock.vue","../src/components/nodes/Emphasis.vue","../src/components/nodes/Heading.vue","../src/components/nodes/LineBreak.vue","../src/components/nodes/Table.vue","../src/types/index.ts","../src/components/nodes/TableRow.vue","../src/components/nodes/TableCell.vue","../src/components/nodes/Text.vue","../src/components/nodes/TextBlock.vue","../src/components/nodes/Paragraph.vue","../src/components/nodes/List.vue","../src/components/nodes/ListItem.vue","../src/components/renderChildren.tsx","../src/components/DocumentViewer.vue"],"sourcesContent":["<template>\n <blockquote>\n <slot />\n </blockquote>\n</template>\n\n<style scoped>\nblockquote {\n background: var(--document-viewer-blockquote-background, #f8f8fa);\n border-left: 2.5px solid var(--document-viewer-blockquote-border, var(--text_colors-accent, #0b172d));\n border-radius: var(--document-viewer-blockquote-border-radius, 3px);\n font-size: 14px;\n margin: var(--spacing-sm, 12px) var(--spacing-sm, 12px);\n padding: var(--spacing-sm, 12px);\n}\n</style>\n","<template>\n <code>\n <slot />\n </code>\n</template>\n\n<style scoped>\ncode {\n background: var(--document-viewer-code-background, #f1f1f1);\n border-radius: var(--document-viewer-code-border-radius, 3px);\n color: var(--document-viewer-code-color, inherit);\n font-family: var(--document-viewer-code-font-family, var(--document-viewer-font-family-monospace));\n font-size: var(--document-viewer-code-font-size, 14px);\n padding: 4px 6px;\n}\n</style>\n","<template>\n <pre><code><slot /></code></pre>\n</template>\n\n<style scoped>\npre {\n background: var(--document-viewer-code-block-background, #f1f1f1);\n border-radius: var(--document-viewer-code-block-border-radius, 3px);\n color: var(--document-viewer-code-block-color, inherit);\n font-family: var(--document-viewer-code-block-font-family, var(--document-viewer-font-family-monospace));\n font-size: var(--document-viewer-code-block-font-size, 14px);\n margin-bottom: var(--spacing-sm, 12px);\n padding: 12px;\n}\n</style>\n","<template>\n <component :is=\"tag\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nconst props = defineProps({\n level: {\n type: Number,\n default: 1,\n validator(value: unknown): boolean {\n if (!Number.isInteger(value)) {\n return false\n }\n\n const num = value as number\n return num > 0 && num < 3\n },\n },\n})\n\nconst tag = props.level === 1 ? 'em' : 'strong'\n</script>\n","<template>\n <component :is=\"tag\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nconst props = defineProps({\n level: {\n type: Number,\n validator(value: unknown): boolean {\n if (!Number.isInteger(value)) {\n return false\n }\n\n const num = value as number\n\n return num > 0 && num < 7\n },\n default: 1,\n },\n})\n\nconst tag = `h${props.level}`\n</script>\n\n<style scoped>\nh1, h2, h3, h4, h5, h6 {\n color: var(--document-viewer-color, var(--text_colors-headings, #0b172d));\n font-family: var(--document-viewer-font-family-headings, var(--document-viewer-font-family-default));\n font-weight: var(--document-viewer-heading-font-weight, 500);\n margin-top: 0;\n}\n\nh1 {\n font-size: 32px;\n font-weight: 500;\n line-height: 38px;\n margin-bottom: var(--spacing-xxl, 48px);\n}\n\nh2 {\n font-size: 24px;\n line-height: 20px;\n margin-bottom: var(--spacing-lg, 24px);\n}\n\nh3 {\n font-size: 20px;\n line-height: 20px;\n margin-bottom: var(--spacing-sm, 12px);\n}\n\nh4 {\n font-size: 18px;\n line-height: 20px;\n margin-bottom: var(--spacing-sm, 12px);\n}\n\nh5 {\n font-size: 16px;\n line-height: 20px;\n margin-bottom: var(--spacing-sm, 12px);\n}\n\nh6 {\n font-size: 14.5px;\n line-height: 20px;\n margin-bottom: var(--spacing-sm, 12px);\n}\n\nh1:first-child, h2:first-child, h3:first-child, h4:first-child, h5:first-child, h6:first-child {\n margin-top: 0;\n}\n</style>\n","<template>\n <hr />\n</template>\n","<template>\n <table>\n <slot />\n </table>\n</template>\n","/* eslint-disable no-unused-vars */\nexport interface BaseNode<Type extends string = string> {\n type: Type\n children?: Array<BaseNode>\n}\n\n// TODO: Reach out to DevX for a proper interface\nexport interface Document extends BaseNode<'document'> {\n children: Array<BaseNode>\n version: number\n}\n\nexport enum TableRowSection {\n header = 'header',\n body = 'body',\n footer = 'footer'\n}\n\nexport enum TableCellAlign {\n left = 'left',\n center = 'center',\n right = 'right'\n}\n\nexport interface TableCellNode extends BaseNode<'table_cell'> {\n align?: TableCellAlign\n}\n\nexport interface TableRowNode extends BaseNode<'table_row'> {\n section?: TableRowSection\n children: Array<TableCellNode>\n}\n\nexport interface TextNode extends BaseNode<'text'> {\n text: string\n children: undefined\n hardBreak?: boolean\n}\n\nexport interface HeadingNode extends BaseNode<'heading'> {\n level: number\n}\n\nexport interface ListItemNode extends BaseNode<'list_item'> {}\n\nexport interface ListNode extends BaseNode<'list'> {\n isOrdered?: boolean\n children: Array<ListItemNode>\n}\n\nexport interface LinkNode extends BaseNode<'link'> {\n href: string\n}\n","<template>\n <component :is=\"tag\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { PropType } from 'vue'\nimport { TableRowSection } from '../../types'\n\nconst props = defineProps({\n section: {\n type: String as PropType<TableRowSection>,\n default: TableRowSection.body,\n },\n})\n\nlet tag: string\nif (props.section === TableRowSection.header) {\n tag = 'thead'\n} else if (props.section === TableRowSection.body) {\n tag = 'tbody'\n} else if (props.section === TableRowSection.footer) {\n tag = 'tfoot'\n}\n</script>\n","<template>\n <component\n :is=\"tag\"\n :class=\"className\"\n >\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { PropType } from 'vue'\nimport { TableCellAlign, TableRowNode, TableRowSection } from '../../types'\n\nconst props = defineProps({\n align: {\n type: String as PropType<TableCellAlign>,\n default: TableCellAlign.left,\n },\n parent: {\n type: Object as PropType<TableRowNode>,\n required: true,\n },\n})\n\nconst tag = props.parent?.section === TableRowSection.header ? 'th' : 'td'\n\nlet className: string\nif (props.align === TableCellAlign.center) {\n className = 'align-center'\n} else if (props.align === TableCellAlign.right) {\n className = 'align-right'\n}\n</script>\n\n<style scoped>\nth, td {\n text-align: left;\n}\n\n.align-center {\n text-align: center;\n}\n\n.align-right {\n text-align: right;\n}\n</style>\n","<template>\n {{ text }}<br v-if=\"hardBreak\">\n</template>\n\n<script lang=\"ts\">\nexport default {\n inheritAttrs: false,\n}\n</script>\n<script setup lang=\"ts\">\ndefineProps({\n text: {\n type: String,\n required: true,\n },\n hardBreak: {\n type: Boolean,\n default: false,\n },\n})\n</script>\n","<template>\n <span>\n <slot />\n </span>\n</template>\n","<template>\n <p>\n <slot />\n </p>\n</template>\n\n<style scoped>\np {\n font-size: 14px;\n line-height: 20px;\n margin: var(--document-viewer-paragraph-margin, 0 0 12px);\n}\n</style>\n","<template>\n <component :is=\"tag\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nconst props = defineProps({\n isOrdered: {\n type: Boolean,\n default: false,\n },\n})\n\nconst tag = props.isOrdered ? 'ol' : 'ul'\n</script>\n\n<style scoped>\nul, ol {\n font-size: 14px;\n margin-bottom: var(--spacing-sm, 12px);\n margin-left: 16px;\n padding: 0;\n}\n\nol {\n list-style: decimal;\n}\n\nul {\n list-style: disc;\n}\n</style>\n","<template>\n <li>\n <slot />\n </li>\n</template>\n","import { Component } from 'vue'\nimport { BaseNode } from '../types'\nimport Blockquote from './nodes/Blockquote.vue'\nimport Code from './nodes/Code.vue'\nimport CodeBlock from './nodes/CodeBlock.vue'\nimport Emphasis from './nodes/Emphasis.vue'\nimport Heading from './nodes/Heading.vue'\nimport Image from './nodes/Image.vue'\nimport LineBreak from './nodes/LineBreak.vue'\nimport Table from './nodes/Table.vue'\nimport TableRow from './nodes/TableRow.vue'\nimport TableCell from './nodes/TableCell.vue'\nimport Text from './nodes/Text.vue'\nimport TextBlock from './nodes/TextBlock.vue'\nimport Paragraph from './nodes/Paragraph.vue'\nimport List from './nodes/List.vue'\nimport ListItem from './nodes/ListItem.vue'\nimport Link from './nodes/Link.vue'\n\n// The node to component mapping is currently static but may change in the future\nconst nodeTypeToComponentMap: Record<string, Component> = {\n blockquote: Blockquote,\n code: Code,\n code_block: CodeBlock,\n emphasis: Emphasis,\n heading: Heading,\n image: Image,\n line_break: LineBreak,\n link: Link,\n list: List,\n list_item: ListItem,\n paragraph: Paragraph,\n table: Table,\n table_row: TableRow,\n table_cell: TableCell,\n text: Text,\n text_block: TextBlock,\n}\n\nconst nodeTypesNotified: Array<string> = []\nfunction notifyUnknownNodeType(type: string) {\n if (nodeTypesNotified.indexOf(type) !== -1) {\n return\n }\n\n nodeTypesNotified.push(type)\n console.warn(`[DocumentViewer] Unable to render an unknown node type \"${type}\"`)\n}\n\nexport default function renderChildren<ChildTypes extends BaseNode>(children: Array<ChildTypes>, parent?: BaseNode): Component {\n return children.map((child) => {\n if (!child) {\n return null\n }\n\n const { type, children, ...restProps } = child\n const component = nodeTypeToComponentMap[child.type]\n\n if (!component) {\n notifyUnknownNodeType(type)\n return null\n }\n\n return (\n <component {...restProps} parent={parent}>\n {() => children && renderChildren(children, child)}\n </component>\n )\n })\n}\n","<template>\n <div class=\"document-viewer\">\n <Children />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport renderChildren from './renderChildren'\n\nconst props = defineProps({\n document: {\n type: Object,\n required: true,\n },\n})\n\nconst Children = () => props.document?.children ? renderChildren(props.document.children) : null\n</script>\n\n<style>\n:root {\n --document-viewer-font-family-default: Roboto, Helvetica, sans-serif;\n --document-viewer-font-family-monospace: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\n}\n</style>\n<style scoped>\n.document-viewer {\n color: var(--document-viewer-color, var(--text_colors-primary, #0b172d));\n font-family: var(--document-viewer-font-family-default, var(--font-family-sans));\n font-size: var(--document-viewer-font-size, 16px);\n}\n</style>\n"],"names":["_cache","_openBlock","_createElementBlock","tag","TableRowSection","TableCellAlign","props","_a","className","__default__","nodeTypeToComponentMap","blockquote","Blockquote","code","Code","code_block","CodeBlock","emphasis","Emphasis","heading","Heading","image","Image","line_break","LineBreak","link","list","List","list_item","ListItem","paragraph","Paragraph","table","Table","table_row","TableRow","table_cell","TableCell","text","Text","text_block","TextBlock","nodeTypesNotified","notifyUnknownNodeType","type","indexOf","push","console","warn","renderChildren","children","parent","map","child","restProps","component","_createVNode","_mergeProps","Children"],"mappings":"yXAGeA,EAAA,QADHC,YAAA,EAAAC,qBAAA,aAAA,KAAA,qICCHF,EAAA,QADGC,YAAA,EAAAC,qBAAA,OAAA,KAAA,qICDsBF,EAAA,QAANC,YAAA,EAAAC,qBAAA,MAAA,KAAA,GAAP,mBAAA,OAAA,KAAA,8QCqBrB,MAAMC,IAAY,QAAU,EAAI,KAAO,iUCCjC,MAAAA,EAAM,MAAU,wmBCtBdH,EAAA,+FCEEA,EAAA,QADEC,YAAA,EAAAC,qBAAA,QAAA,KAAA,gECUA,IAAAE,GAAAA,IACVA,EAAA,OAAS,SACTA,EAAA,KAAO,OACPA,EAAA,OAAS,SAHCA,IAAAA,GAAA,CAAA,CAAA,EAMAC,GAAAA,IACVA,EAAA,KAAO,OACPA,EAAA,OAAS,SACTA,EAAA,MAAQ,QAHEA,IAAAA,GAAA,CAAA,CAAA,+GCDR,IAAAF,EACA,OAAAG,EAAM,UAAYF,EAAgB,OAC9BD,EAAA,QACGG,EAAM,UAAYF,EAAgB,KACrCD,EAAA,QACGG,EAAM,UAAYF,EAAgB,SACrCD,EAAA,0SCCFA,IAAMI,EAAAD,EAAM,SAAN,YAAAC,EAAc,WAAYH,EAAgB,OAAS,KAAO,KAElE,IAAAI,EACA,OAAAF,EAAM,QAAUD,EAAe,OACrBG,EAAA,eACHF,EAAM,QAAUD,EAAe,QAC5BG,EAAA,qRCzBdC,EAAe,CACb,aAAc,EAChB,+VCJST,EAAA,QADGC,YAAA,EAAAC,qBAAA,OAAA,KAAA,wFCCNF,EAAA,QADMC,YAAA,EAAAC,qBAAA,IAAA,KAAA,qMCYN,MAAAC,IAAY,UAAY,KAAO,6OCX9BH,EAAA,QADKC,YAAA,EAAAC,qBAAA,KAAA,KAAA,wXCkBNQ,EAAoD,CACxDC,WAAYC,EACZC,KAAMC,EACNC,WAAYC,EACZC,SAAUC,EACVC,QAASC,EACTC,MAAOC,EACPC,WAAYC,EACZC,4CACAC,KAAMC,EACNC,UAAWC,EACXC,UAAWC,EACXC,MAAOC,EACPC,UAAWC,EACXC,WAAYC,EACZC,KAAMC,EACNC,WAAYC,CACd,EAEMC,EAAmC,CAAA,EACzC,SAASC,GAAsBC,EAAc,CACvCF,EAAkBG,QAAQD,CAAI,IAAM,KAIxCF,EAAkBI,KAAKF,CAAI,EAC3BG,QAAQC,KAAM,2DAA0DJ,IAAO,EACjF,CAEe,SAASK,EAA4CC,EAA6BC,EAA8B,CAC7H,OAAOD,EAASE,IAAKC,GAAU,CAC7B,GAAI,CAACA,EACH,OAAO,KAGT,KAAM,CAAET,KAAAA,EAAMM,SAAAA,EAAU,GAAGI,CAAW,EAAGD,EACnCE,EAAY7C,EAAuB2C,EAAMT,IAAI,EAEnD,OAAKW,EAKLC,cAAAD,EAAAE,EAAA,WACiBH,EAAS,CAAA,OAAUH,CAAM,CAAA,EAAA,CAAA,QACrC,IAAMD,GAAYD,EAAeC,EAAUG,CAAK,CAAC,CAAA,GANpDV,GAAsBC,CAAI,EACnB,KAQX,CAAC,CACH,gJCrDMc,EAAW,IAAA,OAAM,OAAAnD,EAAAD,EAAM,WAAN,MAAAC,EAAgB,SAAW0C,EAAe3C,EAAM,SAAS,QAAQ,EAAI"}
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
blockquote[data-v-a9ac327a]{background:#f8f8fa;background:var(--document-viewer-blockquote-background, #f8f8fa);border-left:2.5px solid #0b172d;border-left:2.5px solid var(--document-viewer-blockquote-border, var(--text_colors-accent, #0b172d));border-radius:3px;border-radius:var(--document-viewer-blockquote-border-radius, 3px);font-size:14px;margin:12px;margin:var(--spacing-sm, 12px) var(--spacing-sm, 12px);padding:12px;padding:var(--spacing-sm, 12px)}code[data-v-
|
|
1
|
+
blockquote[data-v-a9ac327a]{background:#f8f8fa;background:var(--document-viewer-blockquote-background, #f8f8fa);border-left:2.5px solid #0b172d;border-left:2.5px solid var(--document-viewer-blockquote-border, var(--text_colors-accent, #0b172d));border-radius:3px;border-radius:var(--document-viewer-blockquote-border-radius, 3px);font-size:14px;margin:12px;margin:var(--spacing-sm, 12px) var(--spacing-sm, 12px);padding:12px;padding:var(--spacing-sm, 12px)}code[data-v-015a6bbb]{background:#f1f1f1;background:var(--document-viewer-code-background, #f1f1f1);border-radius:3px;border-radius:var(--document-viewer-code-border-radius, 3px);color:inherit;color:var(--document-viewer-code-color, inherit);font-family:var(--document-viewer-font-family-monospace);font-family:var(--document-viewer-code-font-family, var(--document-viewer-font-family-monospace));font-size:14px;font-size:var(--document-viewer-code-font-size, 14px);padding:4px 6px}pre[data-v-7d7d103e]{background:#f1f1f1;background:var(--document-viewer-code-block-background, #f1f1f1);border-radius:3px;border-radius:var(--document-viewer-code-block-border-radius, 3px);color:inherit;color:var(--document-viewer-code-block-color, inherit);font-family:var(--document-viewer-font-family-monospace);font-family:var(--document-viewer-code-block-font-family, var(--document-viewer-font-family-monospace));font-size:14px;font-size:var(--document-viewer-code-block-font-size, 14px);margin-bottom:12px;margin-bottom:var(--spacing-sm, 12px);padding:12px}h1[data-v-07152ca1],h2[data-v-07152ca1],h3[data-v-07152ca1],h4[data-v-07152ca1],h5[data-v-07152ca1],h6[data-v-07152ca1]{color:#0b172d;color:var(--document-viewer-color, var(--text_colors-headings, #0b172d));font-family:var(--document-viewer-font-family-default);font-family:var(--document-viewer-font-family-headings, var(--document-viewer-font-family-default));font-weight:500;font-weight:var(--document-viewer-heading-font-weight, 500);margin-top:0}h1[data-v-07152ca1]{font-size:32px;font-weight:500;line-height:38px;margin-bottom:48px;margin-bottom:var(--spacing-xxl, 48px)}h2[data-v-07152ca1]{font-size:24px;line-height:20px;margin-bottom:24px;margin-bottom:var(--spacing-lg, 24px)}h3[data-v-07152ca1]{font-size:20px;line-height:20px;margin-bottom:12px;margin-bottom:var(--spacing-sm, 12px)}h4[data-v-07152ca1]{font-size:18px;line-height:20px;margin-bottom:12px;margin-bottom:var(--spacing-sm, 12px)}h5[data-v-07152ca1]{font-size:16px;line-height:20px;margin-bottom:12px;margin-bottom:var(--spacing-sm, 12px)}h6[data-v-07152ca1]{font-size:14.5px;line-height:20px;margin-bottom:12px;margin-bottom:var(--spacing-sm, 12px)}h1[data-v-07152ca1]:first-child,h2[data-v-07152ca1]:first-child,h3[data-v-07152ca1]:first-child,h4[data-v-07152ca1]:first-child,h5[data-v-07152ca1]:first-child,h6[data-v-07152ca1]:first-child{margin-top:0}th[data-v-6da63f53],td[data-v-6da63f53]{text-align:left}.align-center[data-v-6da63f53]{text-align:center}.align-right[data-v-6da63f53]{text-align:right}p[data-v-c7681718]{font-size:14px;line-height:20px;margin:0 0 12px;margin:var(--document-viewer-paragraph-margin, 0 0 12px)}ul[data-v-f52e8277],ol[data-v-f52e8277]{font-size:14px;margin-bottom:12px;margin-bottom:var(--spacing-sm, 12px);margin-left:16px;padding:0}ol[data-v-f52e8277]{list-style:decimal}ul[data-v-f52e8277]{list-style:disc}a[data-v-9b27e235]{color:#1155cb;color:var(--document-viewer-link-color, #1155cb);text-decoration:none}a[data-v-9b27e235]:hover{color:#5e8adc;color:var(--document-viewer-link-hover-color, #5e8adc);text-decoration:underline}:root{--document-viewer-font-family-default: Roboto, Helvetica, sans-serif;--document-viewer-font-family-monospace: Consolas, "Liberation Mono", Menlo, Courier, monospace}.document-viewer[data-v-4b223d3a]{color:#0b172d;color:var(--document-viewer-color, var(--text_colors-primary, #0b172d));font-family:var(--font-family-sans);font-family:var(--document-viewer-font-family-default, var(--font-family-sans));font-size:16px;font-size:var(--document-viewer-font-size, 16px)}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}
|
|
1
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>, {
|
|
2
|
+
default: (_: {}) => any;
|
|
3
|
+
}>;
|
|
2
4
|
export default _default;
|
|
5
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
6
|
+
new (): {
|
|
7
|
+
$slots: S;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
3
10
|
//# sourceMappingURL=TextBlock.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/nodes/TextBlock.vue.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"TextBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/nodes/TextBlock.vue.ts"],"names":[],"mappings":";wBA2CgC,GAAG;;AA3CnC,wBAwDc;AACd,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAAE,MAAM,EAAE,CAAC,CAAA;KAAE,CAAA;CAAE,CAAC"}
|