@kong-ui-public/document-viewer 0.2.0
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/LICENSE +201 -0
- package/README.md +68 -0
- package/dist/document-viewer.es.js +299 -0
- package/dist/document-viewer.es.js.map +1 -0
- package/dist/document-viewer.umd.js +2 -0
- package/dist/document-viewer.umd.js.map +1 -0
- package/dist/style.css +1 -0
- package/dist/types/components/DocumentViewer.vue.d.ts +13 -0
- package/dist/types/components/DocumentViewer.vue.d.ts.map +1 -0
- package/dist/types/components/nodes/Blockquote.vue.d.ts +10 -0
- package/dist/types/components/nodes/Blockquote.vue.d.ts.map +1 -0
- package/dist/types/components/nodes/Code.vue.d.ts +10 -0
- package/dist/types/components/nodes/Code.vue.d.ts.map +1 -0
- package/dist/types/components/nodes/CodeBlock.vue.d.ts +10 -0
- package/dist/types/components/nodes/CodeBlock.vue.d.ts.map +1 -0
- package/dist/types/components/nodes/Emphasis.vue.d.ts +24 -0
- package/dist/types/components/nodes/Emphasis.vue.d.ts.map +1 -0
- package/dist/types/components/nodes/Heading.vue.d.ts +24 -0
- package/dist/types/components/nodes/Heading.vue.d.ts.map +1 -0
- package/dist/types/components/nodes/Image.vue.d.ts +39 -0
- package/dist/types/components/nodes/Image.vue.d.ts.map +1 -0
- package/dist/types/components/nodes/LineBreak.vue.d.ts +3 -0
- package/dist/types/components/nodes/LineBreak.vue.d.ts.map +1 -0
- package/dist/types/components/nodes/Link.vue.d.ts +30 -0
- package/dist/types/components/nodes/Link.vue.d.ts.map +1 -0
- package/dist/types/components/nodes/List.vue.d.ts +22 -0
- package/dist/types/components/nodes/List.vue.d.ts.map +1 -0
- package/dist/types/components/nodes/ListItem.vue.d.ts +10 -0
- package/dist/types/components/nodes/ListItem.vue.d.ts.map +1 -0
- package/dist/types/components/nodes/Paragraph.vue.d.ts +10 -0
- package/dist/types/components/nodes/Paragraph.vue.d.ts.map +1 -0
- package/dist/types/components/nodes/Table.vue.d.ts +10 -0
- package/dist/types/components/nodes/Table.vue.d.ts.map +1 -0
- package/dist/types/components/nodes/TableCell.vue.d.ts +32 -0
- package/dist/types/components/nodes/TableCell.vue.d.ts.map +1 -0
- package/dist/types/components/nodes/TableRow.vue.d.ts +24 -0
- package/dist/types/components/nodes/TableRow.vue.d.ts.map +1 -0
- package/dist/types/components/nodes/Text.vue.d.ts +23 -0
- package/dist/types/components/nodes/Text.vue.d.ts.map +1 -0
- package/dist/types/components/nodes/TextBlock.vue.d.ts +3 -0
- package/dist/types/components/nodes/TextBlock.vue.d.ts.map +1 -0
- package/dist/types/components/renderChildren.d.ts +4 -0
- package/dist/types/components/renderChildren.d.ts.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +43 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/package.json +54 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2023 Kong, Inc.
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# @kong-ui-public/document-viewer
|
|
2
|
+
|
|
3
|
+
A Kong UI component for rendering markdown documents
|
|
4
|
+
|
|
5
|
+
- [Features](#features)
|
|
6
|
+
- [Requirements](#requirements)
|
|
7
|
+
- [Usage](#usage)
|
|
8
|
+
- [Install](#install)
|
|
9
|
+
- [Register](#register)
|
|
10
|
+
- [Props](#props)
|
|
11
|
+
- [`document`](#document)
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- Render `.md` content
|
|
16
|
+
- Customize display of markdown content in the UI
|
|
17
|
+
|
|
18
|
+
## Requirements
|
|
19
|
+
|
|
20
|
+
- `vue` must be initialized in the host application
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
### Install
|
|
25
|
+
|
|
26
|
+
Install the component in your host application
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
yarn add @kong-ui-public/document-viewer
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Register
|
|
33
|
+
|
|
34
|
+
You can register `portal-document-viewer` globally or locally.
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
// Global registration
|
|
38
|
+
import { createApp } from 'vue'
|
|
39
|
+
import DocumentViewer from '@kong-ui-public/document-viewer'
|
|
40
|
+
import '@kong-ui-public/document-viewer/dist/style.css'
|
|
41
|
+
|
|
42
|
+
const app = createApp(App)
|
|
43
|
+
|
|
44
|
+
app.use(DocumentViewer)
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
```html
|
|
49
|
+
<!-- Local registration -->
|
|
50
|
+
<template>
|
|
51
|
+
<DocumentViewer />
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<script setup lang="ts">
|
|
55
|
+
import DocumentViewer from '@kong-ui-public/document-viewer'
|
|
56
|
+
import '@kong-ui-public/document-viewer/dist/style.css'
|
|
57
|
+
</script>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Props
|
|
61
|
+
|
|
62
|
+
### `document`
|
|
63
|
+
|
|
64
|
+
- type: `String|Object`
|
|
65
|
+
- required: `true`
|
|
66
|
+
- default: `null`
|
|
67
|
+
|
|
68
|
+
Markdown object or string. Required.
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import { openBlock as r, createElementBlock as s, renderSlot as c, createElementVNode as y, defineComponent as l, createBlock as d, resolveDynamicComponent as i, unref as f, withCtx as p, normalizeClass as x, Fragment as $, createTextVNode as B, toDisplayString as C, createCommentVNode as I, renderList as w, createVNode as b, mergeProps as N } from "vue";
|
|
2
|
+
const _ = (e, t) => {
|
|
3
|
+
const n = e.__vccOpts || e;
|
|
4
|
+
for (const [o, a] of t)
|
|
5
|
+
n[o] = a;
|
|
6
|
+
return n;
|
|
7
|
+
}, q = {};
|
|
8
|
+
function L(e, t) {
|
|
9
|
+
return r(), s("blockquote", null, [
|
|
10
|
+
c(e.$slots, "default", {}, void 0, !0)
|
|
11
|
+
]);
|
|
12
|
+
}
|
|
13
|
+
const V = /* @__PURE__ */ _(q, [["render", L], ["__scopeId", "data-v-a8782cda"]]);
|
|
14
|
+
const S = {};
|
|
15
|
+
function T(e, t) {
|
|
16
|
+
return r(), s("code", null, [
|
|
17
|
+
c(e.$slots, "default", {}, void 0, !0)
|
|
18
|
+
]);
|
|
19
|
+
}
|
|
20
|
+
const D = /* @__PURE__ */ _(S, [["render", T], ["__scopeId", "data-v-3a37391f"]]);
|
|
21
|
+
const O = {};
|
|
22
|
+
function P(e, t) {
|
|
23
|
+
return r(), s("pre", null, [
|
|
24
|
+
y("code", null, [
|
|
25
|
+
c(e.$slots, "default", {}, void 0, !0)
|
|
26
|
+
])
|
|
27
|
+
]);
|
|
28
|
+
}
|
|
29
|
+
const E = /* @__PURE__ */ _(O, [["render", P], ["__scopeId", "data-v-cd7c1ff1"]]), H = /* @__PURE__ */ l({
|
|
30
|
+
__name: "Emphasis",
|
|
31
|
+
props: {
|
|
32
|
+
level: {
|
|
33
|
+
type: Number,
|
|
34
|
+
default: 1,
|
|
35
|
+
validator(e) {
|
|
36
|
+
if (!Number.isInteger(e))
|
|
37
|
+
return !1;
|
|
38
|
+
const t = e;
|
|
39
|
+
return t > 0 && t < 3;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
setup(e) {
|
|
44
|
+
const n = e.level === 1 ? "em" : "strong";
|
|
45
|
+
return (o, a) => (r(), d(i(f(n)), null, {
|
|
46
|
+
default: p(() => [
|
|
47
|
+
c(o.$slots, "default")
|
|
48
|
+
]),
|
|
49
|
+
_: 3
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
}), j = /* @__PURE__ */ l({
|
|
53
|
+
__name: "Heading",
|
|
54
|
+
props: {
|
|
55
|
+
level: {
|
|
56
|
+
type: Number,
|
|
57
|
+
validator(e) {
|
|
58
|
+
if (!Number.isInteger(e))
|
|
59
|
+
return !1;
|
|
60
|
+
const t = e;
|
|
61
|
+
return t > 0 && t < 7;
|
|
62
|
+
},
|
|
63
|
+
default: 1
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
setup(e) {
|
|
67
|
+
const n = `h${e.level}`;
|
|
68
|
+
return (o, a) => (r(), d(i(n), null, {
|
|
69
|
+
default: p(() => [
|
|
70
|
+
c(o.$slots, "default", {}, void 0, !0)
|
|
71
|
+
]),
|
|
72
|
+
_: 3
|
|
73
|
+
}));
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
const U = /* @__PURE__ */ _(j, [["__scopeId", "data-v-0d3059f4"]]), z = ["alt", "src", "title"], F = /* @__PURE__ */ l({
|
|
77
|
+
__name: "Image",
|
|
78
|
+
props: {
|
|
79
|
+
url: {
|
|
80
|
+
type: String,
|
|
81
|
+
required: !0
|
|
82
|
+
},
|
|
83
|
+
alt: {
|
|
84
|
+
type: String,
|
|
85
|
+
default: ""
|
|
86
|
+
},
|
|
87
|
+
title: {
|
|
88
|
+
type: String,
|
|
89
|
+
default: ""
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
setup(e) {
|
|
93
|
+
return (t, n) => (r(), s("figure", null, [
|
|
94
|
+
y("img", {
|
|
95
|
+
alt: e.alt,
|
|
96
|
+
src: e.url,
|
|
97
|
+
title: e.title
|
|
98
|
+
}, null, 8, z),
|
|
99
|
+
y("figcaption", null, [
|
|
100
|
+
c(t.$slots, "default")
|
|
101
|
+
])
|
|
102
|
+
]));
|
|
103
|
+
}
|
|
104
|
+
}), M = {};
|
|
105
|
+
function G(e, t) {
|
|
106
|
+
return r(), s("hr");
|
|
107
|
+
}
|
|
108
|
+
const J = /* @__PURE__ */ _(M, [["render", G]]), K = {};
|
|
109
|
+
function Q(e, t) {
|
|
110
|
+
return r(), s("table", null, [
|
|
111
|
+
c(e.$slots, "default")
|
|
112
|
+
]);
|
|
113
|
+
}
|
|
114
|
+
const W = /* @__PURE__ */ _(K, [["render", Q]]);
|
|
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 X = /* @__PURE__ */ l({
|
|
117
|
+
__name: "TableRow",
|
|
118
|
+
props: {
|
|
119
|
+
section: {
|
|
120
|
+
type: String,
|
|
121
|
+
default: u.body
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
setup(e) {
|
|
125
|
+
const t = e;
|
|
126
|
+
let n;
|
|
127
|
+
return t.section === u.header ? n = "thead" : t.section === u.body ? n = "tbody" : t.section === u.footer && (n = "tfoot"), (o, a) => (r(), d(i(f(n)), null, {
|
|
128
|
+
default: p(() => [
|
|
129
|
+
c(o.$slots, "default")
|
|
130
|
+
]),
|
|
131
|
+
_: 3
|
|
132
|
+
}));
|
|
133
|
+
}
|
|
134
|
+
}), Y = /* @__PURE__ */ l({
|
|
135
|
+
__name: "TableCell",
|
|
136
|
+
props: {
|
|
137
|
+
align: {
|
|
138
|
+
type: String,
|
|
139
|
+
default: m.left
|
|
140
|
+
},
|
|
141
|
+
parent: {
|
|
142
|
+
type: Object,
|
|
143
|
+
required: !0
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
setup(e) {
|
|
147
|
+
var a;
|
|
148
|
+
const t = e, n = ((a = t.parent) == null ? void 0 : a.section) === u.header ? "th" : "td";
|
|
149
|
+
let o;
|
|
150
|
+
return t.align === m.center ? o = "align-center" : t.align === m.right && (o = "align-right"), (g, h) => (r(), d(i(f(n)), {
|
|
151
|
+
class: x(f(o))
|
|
152
|
+
}, {
|
|
153
|
+
default: p(() => [
|
|
154
|
+
c(g.$slots, "default", {}, void 0, !0)
|
|
155
|
+
]),
|
|
156
|
+
_: 3
|
|
157
|
+
}, 8, ["class"]));
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
const Z = /* @__PURE__ */ _(Y, [["__scopeId", "data-v-6da63f53"]]), A = { key: 0 }, R = {
|
|
161
|
+
inheritAttrs: !1
|
|
162
|
+
}, ee = /* @__PURE__ */ l({
|
|
163
|
+
...R,
|
|
164
|
+
__name: "Text",
|
|
165
|
+
props: {
|
|
166
|
+
text: {
|
|
167
|
+
type: String,
|
|
168
|
+
required: !0
|
|
169
|
+
},
|
|
170
|
+
hardBreak: {
|
|
171
|
+
type: Boolean,
|
|
172
|
+
default: !1
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
setup(e) {
|
|
176
|
+
return (t, n) => (r(), s($, null, [
|
|
177
|
+
B(C(e.text) + " ", 1),
|
|
178
|
+
e.hardBreak ? (r(), s("br", A)) : I("", !0)
|
|
179
|
+
], 64));
|
|
180
|
+
}
|
|
181
|
+
}), te = {};
|
|
182
|
+
function ne(e, t) {
|
|
183
|
+
return r(!0), s($, null, w(e.$slots.default || [], (n) => (r(), d(i(n)))), 256);
|
|
184
|
+
}
|
|
185
|
+
const re = /* @__PURE__ */ _(te, [["render", ne]]);
|
|
186
|
+
const oe = {};
|
|
187
|
+
function se(e, t) {
|
|
188
|
+
return r(), s("p", null, [
|
|
189
|
+
c(e.$slots, "default", {}, void 0, !0)
|
|
190
|
+
]);
|
|
191
|
+
}
|
|
192
|
+
const ce = /* @__PURE__ */ _(oe, [["render", se], ["__scopeId", "data-v-b4d199e5"]]), _e = /* @__PURE__ */ l({
|
|
193
|
+
__name: "List",
|
|
194
|
+
props: {
|
|
195
|
+
isOrdered: {
|
|
196
|
+
type: Boolean,
|
|
197
|
+
default: !1
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
setup(e) {
|
|
201
|
+
const n = e.isOrdered ? "ol" : "ul";
|
|
202
|
+
return (o, a) => (r(), d(i(f(n)), null, {
|
|
203
|
+
default: p(() => [
|
|
204
|
+
c(o.$slots, "default", {}, void 0, !0)
|
|
205
|
+
]),
|
|
206
|
+
_: 3
|
|
207
|
+
}));
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
const ae = /* @__PURE__ */ _(_e, [["__scopeId", "data-v-9fef420f"]]), le = {};
|
|
211
|
+
function ue(e, t) {
|
|
212
|
+
return r(), s("li", null, [
|
|
213
|
+
c(e.$slots, "default")
|
|
214
|
+
]);
|
|
215
|
+
}
|
|
216
|
+
const de = /* @__PURE__ */ _(le, [["render", ue]]), ie = ["href", "title"], fe = /* @__PURE__ */ l({
|
|
217
|
+
__name: "Link",
|
|
218
|
+
props: {
|
|
219
|
+
href: {
|
|
220
|
+
type: String,
|
|
221
|
+
required: !0
|
|
222
|
+
},
|
|
223
|
+
title: {
|
|
224
|
+
type: String,
|
|
225
|
+
default: ""
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
setup(e) {
|
|
229
|
+
return (t, n) => (r(), s("a", {
|
|
230
|
+
href: e.href,
|
|
231
|
+
rel: "noreferrer noopener nofollow",
|
|
232
|
+
title: e.title
|
|
233
|
+
}, [
|
|
234
|
+
c(t.$slots, "default", {}, void 0, !0)
|
|
235
|
+
], 8, ie));
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
const pe = /* @__PURE__ */ _(fe, [["__scopeId", "data-v-9b27e235"]]), me = {
|
|
239
|
+
blockquote: V,
|
|
240
|
+
code: D,
|
|
241
|
+
code_block: E,
|
|
242
|
+
emphasis: H,
|
|
243
|
+
heading: U,
|
|
244
|
+
image: F,
|
|
245
|
+
line_break: J,
|
|
246
|
+
link: pe,
|
|
247
|
+
list: ae,
|
|
248
|
+
list_item: de,
|
|
249
|
+
paragraph: ce,
|
|
250
|
+
table: W,
|
|
251
|
+
table_row: X,
|
|
252
|
+
table_cell: Z,
|
|
253
|
+
text: ee,
|
|
254
|
+
text_block: re
|
|
255
|
+
}, v = [];
|
|
256
|
+
function ge(e) {
|
|
257
|
+
v.indexOf(e) === -1 && (v.push(e), console.warn(`[DocumentViewer] Unable to render an unknown node type "${e}"`));
|
|
258
|
+
}
|
|
259
|
+
function k(e, t) {
|
|
260
|
+
return e.map((n) => {
|
|
261
|
+
if (!n)
|
|
262
|
+
return null;
|
|
263
|
+
const {
|
|
264
|
+
type: o,
|
|
265
|
+
children: a,
|
|
266
|
+
...g
|
|
267
|
+
} = n, h = me[n.type];
|
|
268
|
+
return h ? b(h, N(g, {
|
|
269
|
+
parent: t
|
|
270
|
+
}), {
|
|
271
|
+
default: () => a && k(a, n)
|
|
272
|
+
}) : (ge(n.type), null);
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
const he = { class: "document-viewer" }, ye = /* @__PURE__ */ l({
|
|
276
|
+
__name: "DocumentViewer",
|
|
277
|
+
props: {
|
|
278
|
+
document: {
|
|
279
|
+
type: Object,
|
|
280
|
+
required: !0
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
setup(e) {
|
|
284
|
+
const t = e, n = () => {
|
|
285
|
+
var o;
|
|
286
|
+
return (o = t.document) != null && o.children ? k(t.document.children) : null;
|
|
287
|
+
};
|
|
288
|
+
return (o, a) => (r(), s("div", he, [
|
|
289
|
+
b(n)
|
|
290
|
+
]));
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
const $e = /* @__PURE__ */ _(ye, [["__scopeId", "data-v-04ff39e7"]]);
|
|
294
|
+
export {
|
|
295
|
+
m as TableCellAlign,
|
|
296
|
+
u as TableRowSection,
|
|
297
|
+
$e as default
|
|
298
|
+
};
|
|
299
|
+
//# sourceMappingURL=document-viewer.es.js.map
|
|
@@ -0,0 +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 margin: var(--document-viewer-blockquote-margin, 16px 0);\n padding: var(--document-viewer-blockquote-padding, 16px 19px);\n background: var(--document-viewer-blockquote-background, #f8f8fa);\n border-radius: var(--document-viewer-blockquote-border-radius, 3px);\n}\n</style>\n","<template>\n <code>\n <slot />\n </code>\n</template>\n\n<style scoped>\ncode {\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 background: var(--document-viewer-code-background, #f1f1f1);\n color: var(--document-viewer-code-color, inherit);\n border-radius: var(--document-viewer-code-border-radius, 3px);\n}\n</style>\n","<template>\n <pre><code><slot /></code></pre>\n</template>\n\n<style scoped>\npre {\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 background: var(--document-viewer-code-block-background, #f1f1f1);\n color: var(--document-viewer-code-block-color, inherit);\n border-radius: var(--document-viewer-code-block-border-radius, 3px);\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 font-family: var(--document-viewer-heading-font-family, var(--document-viewer-font-family));\n font-weight: var(--document-viewer-heading-font-weight, 400);\n color: var(--document-viewer-heading-color, var(--document-viewer-color));\n}\n\nh1 {\n font-size: var(--document-viewer-heading-h1-font-size, 34px);\n margin: var(--document-viewer-heading-h1-margin, 40px 0 16px);\n line-height: 1.2;\n}\n\nh2 {\n font-size: var(--document-viewer-heading-h2-font-size, 28px);\n margin: var(--document-viewer-heading-h2-margin, 32px 0 16px);\n line-height: 1.25;\n}\n\nh3 {\n font-size: var(--document-viewer-heading-h3-font-size, 24px);\n margin: var(--document-viewer-heading-h3-margin, 28px 0 16px);\n line-height: 1.3;\n}\n\nh4 {\n font-size: var(--document-viewer-heading-h4-font-size, 20px);\n margin: var(--document-viewer-heading-h4-margin, 20px 0 16px);\n line-height: 1.35;\n}\n\nh5 {\n font-size: var(--document-viewer-heading-h5-font-size, 16px);\n margin: var(--document-viewer-heading-h5-margin, 16px 0);\n line-height: 1.5;\n}\n\nh6 {\n font-size: var(--document-viewer-heading-h6-font-size, 12px);\n margin: var(--document-viewer-heading-h6-margin, 10px 0 16px);\n line-height: 1.6;\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 margin: var(--document-viewer-paragraph-margin, 16px 0);\n line-height: var(--document-viewer-paragraph-line-height, 1.5);\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 margin: var(--document-viewer-list-margin, 24px 0);\n padding: var(--document-viewer-list-padding, 0 0 0 20px);\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 font-family: var(--document-viewer-font-family-default);\n font-size: var(--document-viewer-font-size, 16px);\n color: var(--document-viewer-color, #000);\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":";;;;;;;cAGeA,GAAA;SADHC,EAAA,GAAAC,EAAA,cAAA,MAAA;AAAA;;;;;cCCHF,GAAA;SADGC,EAAA,GAAAC,EAAA,QAAA,MAAA;AAAA;;;;;cCDsBF,GAAA;SAANC,EAAA,GAAAC,EAAA,OAAA,MAAA;AAAA,MAAP,QAAA,MAAA;AAAA;;;;;;;;;;;;;;;;;;;ACqBrB,UAAMC,MAAY,UAAU,IAAI,OAAO;;;;;;;;;;;;;;;;;;;;;;;ACCjC,UAAAA,IAAM,MAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCtBdH,GAAA;;;;cCEEA,GAAA;SADEC,EAAA,GAAAC,EAAA,SAAA,MAAA;AAAA;;;;ACUA,IAAAE,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,OAAO,QACPA,EAAA,SAAS,UAHCA,IAAAA,KAAA,CAAA,CAAA,GAMAC,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,SAAS,UACTA,EAAA,QAAQ,SAHEA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;ACDR,QAAAF;AACA,WAAAG,EAAM,YAAYF,EAAgB,SAC9BD,IAAA,UACGG,EAAM,YAAYF,EAAgB,OACrCD,IAAA,UACGG,EAAM,YAAYF,EAAgB,WACrCD,IAAA;;;;;;;;;;;;;;;;;;;;;iBCCFA,MAAMI,IAAAD,EAAM,WAAN,gBAAAC,EAAc,aAAYH,EAAgB,SAAS,OAAO;AAElE,QAAAI;AACA,WAAAF,EAAM,UAAUD,EAAe,SACrBG,IAAA,iBACHF,EAAM,UAAUD,EAAe,UAC5BG,IAAA;;;;;;;;;;oFCxBdC,IAAe;AAAA,EACb,cAAc;AAChB;;;;;;;;;;;;;;;;;;;;ACPE,SAAAC,GAAAC,GAAAX,GAAA;AAIE,SAAAC,EAAA,EAAA,GAAAC,WAAoBU,EAAAD,EAAA,OAAA,WAAA,CAAA,GAAA,CAAAE;;;;eCFlBb,GAAA;SADMC,EAAA,GAAAC,EAAA,KAAA,MAAA;AAAA;;;;;;;;;;;;ACYN,UAAAC,MAAY,YAAY,OAAO;;;;;;;;;;eCX9BH,GAAA;SADKC,EAAA,GAAAC,EAAA,MAAA,MAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;sECkBNY,KAAoD;AAAA,EACxDC,YAAYC;AAAAA,EACZC,MAAMC;AAAAA,EACNC,YAAYC;AAAAA,EACZC,UAAUC;AAAAA,EACVC,SAASC;AAAAA,EACTC,OAAOC;AAAAA,EACPC,YAAYC;AAAAA,EACZC,MAAMC;AAAAA,EACNC,MAAMC;AAAAA,EACNC,WAAWC;AAAAA,EACXC,WAAWC;AAAAA,EACXC,OAAOC;AAAAA,EACPC,WAAWC;AAAAA,EACXC,YAAYC;AAAAA,EACZC,MAAMC;AAAAA,EACNC,YAAYC;AACd,GAEMC,IAAmC,CAAA;AACzC,SAASC,GAAsBC,GAAc;AAC3C,EAAIF,EAAkBG,QAAQD,CAAI,MAAM,OAIxCF,EAAkBI,KAAKF,CAAI,GAC3BG,QAAQC,KAAM,2DAA0DJ,IAAO;AACjF;AAEe,SAASK,EAA4CC,GAA6BC,GAA8B;AAC7H,SAAOD,EAASE,IAAKC,CAAAA,MAAU;AAC7B,QAAI,CAACA;AACH,aAAO;AAGT,UAAM;AAAA,MAAET,MAAAA;AAAAA,MAAMM,UAAAA;AAAAA,MAAU,GAAGI;AAAAA,IAAW,IAAGD,GACnCE,IAAY9C,GAAuB4C,EAAMT,IAAI;AAEnD,WAAKW,IAKLC,EAAAD,GAAAE,EACiBH,GAAS;AAAA,MAAA,QAAUH;AAAAA,IAAM,CAAA,GAAA;AAAA,MAAA,SACrC,MAAMD,KAAYD,EAAeC,GAAUG,CAAK;AAAA,IAAC,CAAA,KANpDV,GAAsBU,EAAMT,IAAI,GACzB;AAAA,EAQX,CAAC;AACH;;;;;;;;;;iBCrDMc,IAAW,MAAA;;AAAM,cAAAxD,IAAAD,EAAM,aAAN,QAAAC,EAAgB,WAAW+C,EAAehD,EAAM,SAAS,QAAQ,IAAI;AAAA;;;;;;;"}
|
|
@@ -0,0 +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-a8782cda"]]),ce="",y={};function h(t,n){return e.openBlock(),e.createElementBlock("code",null,[e.renderSlot(t.$slots,"default",{},void 0,!0)])}const g=c(y,[["render",h],["__scopeId","data-v-3a37391f"]]),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-cd7c1ff1"]]),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-0d3059f4"]]),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))}}),F={};function U(t,n){return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.$slots.default||[],o=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o)))),256)}const z=c(F,[["render",U]]),_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-b4d199e5"]]),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-9fef420f"]]),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:z},f=[];function ee(t){f.indexOf(t)===-1&&(f.push(t),console.warn(`[DocumentViewer] Unable to render an unknown node type "${t}"`))}function p(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&&p(l,o)}):(ee(o.type),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?p(n.document.children):null};return(r,l)=>(e.openBlock(),e.createElementBlock("div",te,[e.createVNode(o)]))}}),pe="",ue="",oe=c(ne,[["__scopeId","data-v-04ff39e7"]]);s.TableCellAlign=_,s.TableRowSection=a,s.default=oe,Object.defineProperties(s,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
2
|
+
//# sourceMappingURL=document-viewer.umd.js.map
|
|
@@ -0,0 +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 margin: var(--document-viewer-blockquote-margin, 16px 0);\n padding: var(--document-viewer-blockquote-padding, 16px 19px);\n background: var(--document-viewer-blockquote-background, #f8f8fa);\n border-radius: var(--document-viewer-blockquote-border-radius, 3px);\n}\n</style>\n","<template>\n <code>\n <slot />\n </code>\n</template>\n\n<style scoped>\ncode {\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 background: var(--document-viewer-code-background, #f1f1f1);\n color: var(--document-viewer-code-color, inherit);\n border-radius: var(--document-viewer-code-border-radius, 3px);\n}\n</style>\n","<template>\n <pre><code><slot /></code></pre>\n</template>\n\n<style scoped>\npre {\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 background: var(--document-viewer-code-block-background, #f1f1f1);\n color: var(--document-viewer-code-block-color, inherit);\n border-radius: var(--document-viewer-code-block-border-radius, 3px);\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 font-family: var(--document-viewer-heading-font-family, var(--document-viewer-font-family));\n font-weight: var(--document-viewer-heading-font-weight, 400);\n color: var(--document-viewer-heading-color, var(--document-viewer-color));\n}\n\nh1 {\n font-size: var(--document-viewer-heading-h1-font-size, 34px);\n margin: var(--document-viewer-heading-h1-margin, 40px 0 16px);\n line-height: 1.2;\n}\n\nh2 {\n font-size: var(--document-viewer-heading-h2-font-size, 28px);\n margin: var(--document-viewer-heading-h2-margin, 32px 0 16px);\n line-height: 1.25;\n}\n\nh3 {\n font-size: var(--document-viewer-heading-h3-font-size, 24px);\n margin: var(--document-viewer-heading-h3-margin, 28px 0 16px);\n line-height: 1.3;\n}\n\nh4 {\n font-size: var(--document-viewer-heading-h4-font-size, 20px);\n margin: var(--document-viewer-heading-h4-margin, 20px 0 16px);\n line-height: 1.35;\n}\n\nh5 {\n font-size: var(--document-viewer-heading-h5-font-size, 16px);\n margin: var(--document-viewer-heading-h5-margin, 16px 0);\n line-height: 1.5;\n}\n\nh6 {\n font-size: var(--document-viewer-heading-h6-font-size, 12px);\n margin: var(--document-viewer-heading-h6-margin, 10px 0 16px);\n line-height: 1.6;\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 margin: var(--document-viewer-paragraph-margin, 16px 0);\n line-height: var(--document-viewer-paragraph-line-height, 1.5);\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 margin: var(--document-viewer-list-margin, 24px 0);\n padding: var(--document-viewer-list-padding, 0 0 0 20px);\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 font-family: var(--document-viewer-font-family-default);\n font-size: var(--document-viewer-font-size, 16px);\n color: var(--document-viewer-color, #000);\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"}
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
blockquote[data-v-a8782cda]{margin:16px 0;margin:var(--document-viewer-blockquote-margin, 16px 0);padding:16px 19px;padding:var(--document-viewer-blockquote-padding, 16px 19px);background:#f8f8fa;background:var(--document-viewer-blockquote-background, #f8f8fa);border-radius:3px;border-radius:var(--document-viewer-blockquote-border-radius, 3px)}code[data-v-3a37391f]{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);background:#f1f1f1;background:var(--document-viewer-code-background, #f1f1f1);color:inherit;color:var(--document-viewer-code-color, inherit);border-radius:3px;border-radius:var(--document-viewer-code-border-radius, 3px)}pre[data-v-cd7c1ff1]{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);background:#f1f1f1;background:var(--document-viewer-code-block-background, #f1f1f1);color:inherit;color:var(--document-viewer-code-block-color, inherit);border-radius:3px;border-radius:var(--document-viewer-code-block-border-radius, 3px)}h1[data-v-0d3059f4],h2[data-v-0d3059f4],h3[data-v-0d3059f4],h4[data-v-0d3059f4],h5[data-v-0d3059f4],h6[data-v-0d3059f4]{font-family:var(--document-viewer-font-family);font-family:var(--document-viewer-heading-font-family, var(--document-viewer-font-family));font-weight:400;font-weight:var(--document-viewer-heading-font-weight, 400);color:var(--document-viewer-color);color:var(--document-viewer-heading-color, var(--document-viewer-color))}h1[data-v-0d3059f4]{font-size:34px;font-size:var(--document-viewer-heading-h1-font-size, 34px);margin:40px 0 16px;margin:var(--document-viewer-heading-h1-margin, 40px 0 16px);line-height:1.2}h2[data-v-0d3059f4]{font-size:28px;font-size:var(--document-viewer-heading-h2-font-size, 28px);margin:32px 0 16px;margin:var(--document-viewer-heading-h2-margin, 32px 0 16px);line-height:1.25}h3[data-v-0d3059f4]{font-size:24px;font-size:var(--document-viewer-heading-h3-font-size, 24px);margin:28px 0 16px;margin:var(--document-viewer-heading-h3-margin, 28px 0 16px);line-height:1.3}h4[data-v-0d3059f4]{font-size:20px;font-size:var(--document-viewer-heading-h4-font-size, 20px);margin:20px 0 16px;margin:var(--document-viewer-heading-h4-margin, 20px 0 16px);line-height:1.35}h5[data-v-0d3059f4]{font-size:16px;font-size:var(--document-viewer-heading-h5-font-size, 16px);margin:16px 0;margin:var(--document-viewer-heading-h5-margin, 16px 0);line-height:1.5}h6[data-v-0d3059f4]{font-size:12px;font-size:var(--document-viewer-heading-h6-font-size, 12px);margin:10px 0 16px;margin:var(--document-viewer-heading-h6-margin, 10px 0 16px);line-height:1.6}h1[data-v-0d3059f4]:first-child,h2[data-v-0d3059f4]:first-child,h3[data-v-0d3059f4]:first-child,h4[data-v-0d3059f4]:first-child,h5[data-v-0d3059f4]:first-child,h6[data-v-0d3059f4]: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-b4d199e5]{margin:16px 0;margin:var(--document-viewer-paragraph-margin, 16px 0);line-height:1.5;line-height:var(--document-viewer-paragraph-line-height, 1.5)}ul[data-v-9fef420f],ol[data-v-9fef420f]{margin:24px 0;margin:var(--document-viewer-list-margin, 24px 0);padding:0 0 0 20px;padding:var(--document-viewer-list-padding, 0 0 0 20px)}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-04ff39e7]{font-family:var(--document-viewer-font-family-default);font-size:16px;font-size:var(--document-viewer-font-size, 16px);color:#000;color:var(--document-viewer-color, #000)}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
document: {
|
|
3
|
+
type: ObjectConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
+
document: {
|
|
8
|
+
type: ObjectConstructor;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
}>>, {}>;
|
|
12
|
+
export default _default;
|
|
13
|
+
//# sourceMappingURL=DocumentViewer.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentViewer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DocumentViewer.vue.ts"],"names":[],"mappings":";;;;;;;;;;;AAGA,wBAuEc"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
}>;
|
|
4
|
+
export default _default;
|
|
5
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
6
|
+
new (): {
|
|
7
|
+
$slots: S;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=Blockquote.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Blockquote.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/nodes/Blockquote.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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
}>;
|
|
4
|
+
export default _default;
|
|
5
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
6
|
+
new (): {
|
|
7
|
+
$slots: S;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=Code.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Code.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/nodes/Code.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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
}>;
|
|
4
|
+
export default _default;
|
|
5
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
6
|
+
new (): {
|
|
7
|
+
$slots: S;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=CodeBlock.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/nodes/CodeBlock.vue.ts"],"names":[],"mappings":";wBAgDgC,GAAG;;AAhDnC,wBA6Dc;AACd,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAAE,MAAM,EAAE,CAAC,CAAA;KAAE,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
2
|
+
level: {
|
|
3
|
+
type: NumberConstructor;
|
|
4
|
+
default: number;
|
|
5
|
+
validator(value: unknown): boolean;
|
|
6
|
+
};
|
|
7
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
8
|
+
level: {
|
|
9
|
+
type: NumberConstructor;
|
|
10
|
+
default: number;
|
|
11
|
+
validator(value: unknown): boolean;
|
|
12
|
+
};
|
|
13
|
+
}>>, {
|
|
14
|
+
level: number;
|
|
15
|
+
}>, {
|
|
16
|
+
default: (_: {}) => any;
|
|
17
|
+
}>;
|
|
18
|
+
export default _default;
|
|
19
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
20
|
+
new (): {
|
|
21
|
+
$slots: S;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=Emphasis.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Emphasis.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/nodes/Emphasis.vue.ts"],"names":[],"mappings":";;;;yBAwBqB,OAAO,GAAG,OAAO;;;;;;yBAAjB,OAAO,GAAG,OAAO;;;;;wBAmDN,GAAG;;AA1EnC,wBAwFc;AACd,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAAE,MAAM,EAAE,CAAC,CAAA;KAAE,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
2
|
+
level: {
|
|
3
|
+
type: NumberConstructor;
|
|
4
|
+
validator(value: unknown): boolean;
|
|
5
|
+
default: number;
|
|
6
|
+
};
|
|
7
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
8
|
+
level: {
|
|
9
|
+
type: NumberConstructor;
|
|
10
|
+
validator(value: unknown): boolean;
|
|
11
|
+
default: number;
|
|
12
|
+
};
|
|
13
|
+
}>>, {
|
|
14
|
+
level: number;
|
|
15
|
+
}>, {
|
|
16
|
+
default: (_: {}) => any;
|
|
17
|
+
}>;
|
|
18
|
+
export default _default;
|
|
19
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
20
|
+
new (): {
|
|
21
|
+
$slots: S;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=Heading.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Heading.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/nodes/Heading.vue.ts"],"names":[],"mappings":";;;yBAwBqB,OAAO,GAAG,OAAO;;;;;;yBAAjB,OAAO,GAAG,OAAO;;;;;;wBAqDN,GAAG;;AA5EnC,wBA0Fc;AACd,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAAE,MAAM,EAAE,CAAC,CAAA;KAAE,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
2
|
+
url: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
alt: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
title: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
|
+
url: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
alt: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
title: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
27
|
+
}>>, {
|
|
28
|
+
title: string;
|
|
29
|
+
alt: string;
|
|
30
|
+
}>, {
|
|
31
|
+
default: (_: {}) => any;
|
|
32
|
+
}>;
|
|
33
|
+
export default _default;
|
|
34
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
35
|
+
new (): {
|
|
36
|
+
$slots: S;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=Image.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/nodes/Image.vue.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAkFgC,GAAG;;AAjFnC,wBA8Fc;AACd,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAAE,MAAM,EAAE,CAAC,CAAA;KAAE,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
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<{}>>, {}>;
|
|
2
|
+
export default _default;
|
|
3
|
+
//# sourceMappingURL=LineBreak.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineBreak.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/nodes/LineBreak.vue.ts"],"names":[],"mappings":";AAAA,wBA+Cc"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
2
|
+
href: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
title: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
|
+
href: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
required: true;
|
|
14
|
+
};
|
|
15
|
+
title: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
}>>, {
|
|
20
|
+
title: string;
|
|
21
|
+
}>, {
|
|
22
|
+
default: (_: {}) => any;
|
|
23
|
+
}>;
|
|
24
|
+
export default _default;
|
|
25
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
26
|
+
new (): {
|
|
27
|
+
$slots: S;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=Link.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/nodes/Link.vue.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;wBAiEgC,GAAG;;AAhEnC,wBA6Ec;AACd,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAAE,MAAM,EAAE,CAAC,CAAA;KAAE,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
2
|
+
isOrdered: {
|
|
3
|
+
type: BooleanConstructor;
|
|
4
|
+
default: boolean;
|
|
5
|
+
};
|
|
6
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
+
isOrdered: {
|
|
8
|
+
type: BooleanConstructor;
|
|
9
|
+
default: boolean;
|
|
10
|
+
};
|
|
11
|
+
}>>, {
|
|
12
|
+
isOrdered: boolean;
|
|
13
|
+
}>, {
|
|
14
|
+
default: (_: {}) => any;
|
|
15
|
+
}>;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=List.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"List.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/nodes/List.vue.ts"],"names":[],"mappings":";;;;;;;;;;;;;wBA2DgC,GAAG;;AA1DnC,wBAwEc;AACd,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAAE,MAAM,EAAE,CAAC,CAAA;KAAE,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
}>;
|
|
4
|
+
export default _default;
|
|
5
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
6
|
+
new (): {
|
|
7
|
+
$slots: S;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=ListItem.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/nodes/ListItem.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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
}>;
|
|
4
|
+
export default _default;
|
|
5
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
6
|
+
new (): {
|
|
7
|
+
$slots: S;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=Paragraph.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Paragraph.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/nodes/Paragraph.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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
}>;
|
|
4
|
+
export default _default;
|
|
5
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
6
|
+
new (): {
|
|
7
|
+
$slots: S;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=Table.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Table.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/nodes/Table.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"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { TableCellAlign, TableRowNode } from '../../types';
|
|
3
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
4
|
+
align: {
|
|
5
|
+
type: PropType<TableCellAlign>;
|
|
6
|
+
default: TableCellAlign;
|
|
7
|
+
};
|
|
8
|
+
parent: {
|
|
9
|
+
type: PropType<TableRowNode>;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
|
+
align: {
|
|
14
|
+
type: PropType<TableCellAlign>;
|
|
15
|
+
default: TableCellAlign;
|
|
16
|
+
};
|
|
17
|
+
parent: {
|
|
18
|
+
type: PropType<TableRowNode>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
}>>, {
|
|
22
|
+
align: TableCellAlign;
|
|
23
|
+
}>, {
|
|
24
|
+
default: (_: {}) => any;
|
|
25
|
+
}>;
|
|
26
|
+
export default _default;
|
|
27
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
28
|
+
new (): {
|
|
29
|
+
$slots: S;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=TableCell.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableCell.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/nodes/TableCell.vue.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AAC9B,OAAO,EAAE,cAAc,EAAE,YAAY,EAAmB,MAAM,aAAa,CAAA;;;;;;;;;;;;;;;;;;;;;;wBA8E3C,GAAG;;AA5EnC,wBA2Fc;AACd,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAAE,MAAM,EAAE,CAAC,CAAA;KAAE,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { TableRowSection } from '../../types';
|
|
3
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
4
|
+
section: {
|
|
5
|
+
type: PropType<TableRowSection>;
|
|
6
|
+
default: TableRowSection;
|
|
7
|
+
};
|
|
8
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
9
|
+
section: {
|
|
10
|
+
type: PropType<TableRowSection>;
|
|
11
|
+
default: TableRowSection;
|
|
12
|
+
};
|
|
13
|
+
}>>, {
|
|
14
|
+
section: TableRowSection;
|
|
15
|
+
}>, {
|
|
16
|
+
default: (_: {}) => any;
|
|
17
|
+
}>;
|
|
18
|
+
export default _default;
|
|
19
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
20
|
+
new (): {
|
|
21
|
+
$slots: S;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=TableRow.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableRow.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/nodes/TableRow.vue.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;;;;;;;;;;;;;;wBAmEb,GAAG;;AAjEnC,wBA+Ec;AACd,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAAE,MAAM,EAAE,CAAC,CAAA;KAAE,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
text: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
hardBreak: {
|
|
7
|
+
type: BooleanConstructor;
|
|
8
|
+
default: boolean;
|
|
9
|
+
};
|
|
10
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
|
+
text: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
required: true;
|
|
14
|
+
};
|
|
15
|
+
hardBreak: {
|
|
16
|
+
type: BooleanConstructor;
|
|
17
|
+
default: boolean;
|
|
18
|
+
};
|
|
19
|
+
}>>, {
|
|
20
|
+
hardBreak: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
export default _default;
|
|
23
|
+
//# sourceMappingURL=Text.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/nodes/Text.vue.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEA,wBA0Ec"}
|
|
@@ -0,0 +1,3 @@
|
|
|
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<{}>>, {}>;
|
|
2
|
+
export default _default;
|
|
3
|
+
//# sourceMappingURL=TextBlock.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/nodes/TextBlock.vue.ts"],"names":[],"mappings":";AAAA,wBAkDc"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderChildren.d.ts","sourceRoot":"","sources":["../../../src/components/renderChildren.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAgDnC,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,UAAU,SAAS,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,CAoB7H"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,iCAAiC,CAAA;AAE5D,eAAe,cAAc,CAAA;AAE7B,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface BaseNode<Type extends string = string> {
|
|
2
|
+
type: Type;
|
|
3
|
+
children?: Array<BaseNode>;
|
|
4
|
+
}
|
|
5
|
+
export interface Document extends BaseNode<'document'> {
|
|
6
|
+
children: Array<BaseNode>;
|
|
7
|
+
version: number;
|
|
8
|
+
}
|
|
9
|
+
export declare enum TableRowSection {
|
|
10
|
+
header = "header",
|
|
11
|
+
body = "body",
|
|
12
|
+
footer = "footer"
|
|
13
|
+
}
|
|
14
|
+
export declare enum TableCellAlign {
|
|
15
|
+
left = "left",
|
|
16
|
+
center = "center",
|
|
17
|
+
right = "right"
|
|
18
|
+
}
|
|
19
|
+
export interface TableCellNode extends BaseNode<'table_cell'> {
|
|
20
|
+
align?: TableCellAlign;
|
|
21
|
+
}
|
|
22
|
+
export interface TableRowNode extends BaseNode<'table_row'> {
|
|
23
|
+
section?: TableRowSection;
|
|
24
|
+
children: Array<TableCellNode>;
|
|
25
|
+
}
|
|
26
|
+
export interface TextNode extends BaseNode<'text'> {
|
|
27
|
+
text: string;
|
|
28
|
+
children: undefined;
|
|
29
|
+
hardBreak?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface HeadingNode extends BaseNode<'heading'> {
|
|
32
|
+
level: number;
|
|
33
|
+
}
|
|
34
|
+
export interface ListItemNode extends BaseNode<'list_item'> {
|
|
35
|
+
}
|
|
36
|
+
export interface ListNode extends BaseNode<'list'> {
|
|
37
|
+
isOrdered?: boolean;
|
|
38
|
+
children: Array<ListItemNode>;
|
|
39
|
+
}
|
|
40
|
+
export interface LinkNode extends BaseNode<'link'> {
|
|
41
|
+
href: string;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,QAAQ,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM;IACpD,IAAI,EAAE,IAAI,CAAA;IACV,QAAQ,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;CAC3B;AAGD,MAAM,WAAW,QAAS,SAAQ,QAAQ,CAAC,UAAU,CAAC;IACpD,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;IACzB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,oBAAY,eAAe;IACzB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,MAAM,WAAW;CAClB;AAED,oBAAY,cAAc;IACxB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED,MAAM,WAAW,aAAc,SAAQ,QAAQ,CAAC,YAAY,CAAC;IAC3D,KAAK,CAAC,EAAE,cAAc,CAAA;CACvB;AAED,MAAM,WAAW,YAAa,SAAQ,QAAQ,CAAC,WAAW,CAAC;IACzD,OAAO,CAAC,EAAE,eAAe,CAAA;IACzB,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC,CAAA;CAC/B;AAED,MAAM,WAAW,QAAS,SAAQ,QAAQ,CAAC,MAAM,CAAC;IAChD,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,MAAM,WAAW,WAAY,SAAQ,QAAQ,CAAC,SAAS,CAAC;IACtD,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,YAAa,SAAQ,QAAQ,CAAC,WAAW,CAAC;CAAG;AAE9D,MAAM,WAAW,QAAS,SAAQ,QAAQ,CAAC,MAAM,CAAC;IAChD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,CAAA;CAC9B;AAED,MAAM,WAAW,QAAS,SAAQ,QAAQ,CAAC,MAAM,CAAC;IAChD,IAAI,EAAE,MAAM,CAAA;CACb"}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kong-ui-public/document-viewer",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/document-viewer.umd.js",
|
|
6
|
+
"module": "./dist/document-viewer.es.js",
|
|
7
|
+
"types": "dist/types/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/document-viewer.es.js",
|
|
14
|
+
"require": "./dist/document-viewer.umd.js"
|
|
15
|
+
},
|
|
16
|
+
"./package.json": "./package.json",
|
|
17
|
+
"./dist/*": "./dist/*"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"vue": "^3.2.45"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@vitejs/plugin-vue-jsx": "^3.0.0",
|
|
27
|
+
"vue": "^3.2.45"
|
|
28
|
+
},
|
|
29
|
+
"repository": "https://github.com/Kong/public-ui-components/tree/main/packages/portal/document-viewer",
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://github.com/Kong/public-ui-components/issues"
|
|
32
|
+
},
|
|
33
|
+
"author": "Kong, Inc.",
|
|
34
|
+
"license": "Apache-2.0",
|
|
35
|
+
"volta": {
|
|
36
|
+
"extends": "../../../package.json"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"dev": "cross-env USE_SANDBOX=true vite",
|
|
40
|
+
"build": "run-s typecheck build:package build:types",
|
|
41
|
+
"build:package": "vite build",
|
|
42
|
+
"build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly",
|
|
43
|
+
"build:visualize": "BUILD_VISUALIZER='portal/document-viewer' vite build -m production",
|
|
44
|
+
"preview:package": "vite preview --port 4173",
|
|
45
|
+
"preview": "cross-env USE_SANDBOX=true PREVIEW_SANDBOX=true run-s build:package preview:package",
|
|
46
|
+
"lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'",
|
|
47
|
+
"lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix",
|
|
48
|
+
"stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'",
|
|
49
|
+
"stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix",
|
|
50
|
+
"typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit",
|
|
51
|
+
"test:component": "BABEL_ENV=cypress cross-env FORCE_COLOR=1 cypress run --component -b chrome --spec './src/**/*.cy.ts' --project '../../../.'",
|
|
52
|
+
"test:component:open": "BABEL_ENV=cypress cross-env FORCE_COLOR=1 cypress open --component -b chrome --project '../../../.'"
|
|
53
|
+
}
|
|
54
|
+
}
|