@mythrantic/svelte-rich-text 0.2.8
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/README.md +289 -0
- package/dist/components/core/blockWrapper.svelte +88 -0
- package/dist/components/core/blockWrapper.svelte.d.ts +19 -0
- package/dist/components/core/editMode.svelte +95 -0
- package/dist/components/core/editMode.svelte.d.ts +16 -0
- package/dist/components/core/main.svelte +196 -0
- package/dist/components/core/main.svelte.d.ts +65 -0
- package/dist/components/core/toolBar.svelte +141 -0
- package/dist/components/core/toolBar.svelte.d.ts +16 -0
- package/dist/components/core/viewMode.svelte +28 -0
- package/dist/components/core/viewMode.svelte.d.ts +25 -0
- package/dist/components/editBlocks/code.svelte +68 -0
- package/dist/components/editBlocks/code.svelte.d.ts +24 -0
- package/dist/components/editBlocks/header.svelte +66 -0
- package/dist/components/editBlocks/header.svelte.d.ts +23 -0
- package/dist/components/editBlocks/img.svelte +47 -0
- package/dist/components/editBlocks/img.svelte.d.ts +24 -0
- package/dist/components/editBlocks/list.svelte +102 -0
- package/dist/components/editBlocks/list.svelte.d.ts +23 -0
- package/dist/components/editBlocks/paragraph.svelte +22 -0
- package/dist/components/editBlocks/paragraph.svelte.d.ts +26 -0
- package/dist/components/editBlocks/quote.svelte +57 -0
- package/dist/components/editBlocks/quote.svelte.d.ts +23 -0
- package/dist/components/editBlocks/space.svelte +24 -0
- package/dist/components/editBlocks/space.svelte.d.ts +22 -0
- package/dist/components/extra/dropDown.svelte +117 -0
- package/dist/components/extra/dropDown.svelte.d.ts +23 -0
- package/dist/components/extra/input.svelte +63 -0
- package/dist/components/extra/input.svelte.d.ts +21 -0
- package/dist/components/extra/select.svelte +50 -0
- package/dist/components/extra/select.svelte.d.ts +30 -0
- package/dist/components/extra/textarea.svelte +40 -0
- package/dist/components/extra/textarea.svelte.d.ts +21 -0
- package/dist/components/extra/upload.svelte +79 -0
- package/dist/components/extra/upload.svelte.d.ts +21 -0
- package/dist/components/icons/closeIcon.svelte +6 -0
- package/dist/components/icons/closeIcon.svelte.d.ts +25 -0
- package/dist/components/icons/closeQuoteIcon.svelte +9 -0
- package/dist/components/icons/closeQuoteIcon.svelte.d.ts +25 -0
- package/dist/components/icons/codeIcon.svelte +12 -0
- package/dist/components/icons/codeIcon.svelte.d.ts +25 -0
- package/dist/components/icons/copyIcon.svelte +12 -0
- package/dist/components/icons/copyIcon.svelte.d.ts +25 -0
- package/dist/components/icons/deleteIcon.svelte +12 -0
- package/dist/components/icons/deleteIcon.svelte.d.ts +25 -0
- package/dist/components/icons/doneIcon.svelte +17 -0
- package/dist/components/icons/doneIcon.svelte.d.ts +25 -0
- package/dist/components/icons/downIcon.svelte +12 -0
- package/dist/components/icons/downIcon.svelte.d.ts +25 -0
- package/dist/components/icons/headerIcon.svelte +12 -0
- package/dist/components/icons/headerIcon.svelte.d.ts +25 -0
- package/dist/components/icons/imageIcon.svelte +12 -0
- package/dist/components/icons/imageIcon.svelte.d.ts +25 -0
- package/dist/components/icons/listIcon.svelte +12 -0
- package/dist/components/icons/listIcon.svelte.d.ts +25 -0
- package/dist/components/icons/menuIcon.svelte +12 -0
- package/dist/components/icons/menuIcon.svelte.d.ts +25 -0
- package/dist/components/icons/openQuoteIcon.svelte +9 -0
- package/dist/components/icons/openQuoteIcon.svelte.d.ts +25 -0
- package/dist/components/icons/paragraphIcon.svelte +12 -0
- package/dist/components/icons/paragraphIcon.svelte.d.ts +25 -0
- package/dist/components/icons/plusIcon.svelte +3 -0
- package/dist/components/icons/plusIcon.svelte.d.ts +25 -0
- package/dist/components/icons/spaceIcon.svelte +9 -0
- package/dist/components/icons/spaceIcon.svelte.d.ts +25 -0
- package/dist/components/icons/upIcon.svelte +12 -0
- package/dist/components/icons/upIcon.svelte.d.ts +25 -0
- package/dist/components/icons/uploadIcon.svelte +9 -0
- package/dist/components/icons/uploadIcon.svelte.d.ts +25 -0
- package/dist/components/viewBlocks/viewCode.svelte +150 -0
- package/dist/components/viewBlocks/viewCode.svelte.d.ts +20 -0
- package/dist/components/viewBlocks/viewHeader.svelte +13 -0
- package/dist/components/viewBlocks/viewHeader.svelte.d.ts +19 -0
- package/dist/components/viewBlocks/viewImage.svelte +35 -0
- package/dist/components/viewBlocks/viewImage.svelte.d.ts +20 -0
- package/dist/components/viewBlocks/viewList.svelte +69 -0
- package/dist/components/viewBlocks/viewList.svelte.d.ts +19 -0
- package/dist/components/viewBlocks/viewParagraph.svelte +12 -0
- package/dist/components/viewBlocks/viewParagraph.svelte.d.ts +18 -0
- package/dist/components/viewBlocks/viewQuote.svelte +29 -0
- package/dist/components/viewBlocks/viewQuote.svelte.d.ts +19 -0
- package/dist/components/viewBlocks/viewSpace.svelte +4 -0
- package/dist/components/viewBlocks/viewSpace.svelte.d.ts +18 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +13 -0
- package/dist/utils/consts.d.ts +96 -0
- package/dist/utils/consts.js +1 -0
- package/dist/utils/functions.d.ts +2 -0
- package/dist/utils/functions.js +12 -0
- package/dist/utils/stores.d.ts +6 -0
- package/dist/utils/stores.js +3 -0
- package/package.json +107 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
<script>import { onMount } from "svelte";
|
|
2
|
+
import CopyIcon from "../icons/copyIcon.svelte";
|
|
3
|
+
import DoneIcon from "../icons/doneIcon.svelte";
|
|
4
|
+
export let text;
|
|
5
|
+
export let lang;
|
|
6
|
+
let formattedCode = "";
|
|
7
|
+
let copyStatement = false;
|
|
8
|
+
async function copyCode(e) {
|
|
9
|
+
e.preventDefault();
|
|
10
|
+
navigator.clipboard.writeText(text);
|
|
11
|
+
copyStatement = true;
|
|
12
|
+
await new Promise((res) => setTimeout(res, 800));
|
|
13
|
+
copyStatement = false;
|
|
14
|
+
}
|
|
15
|
+
onMount(() => {
|
|
16
|
+
formattedCode = addLineNumbersAndEscapeHtml(text);
|
|
17
|
+
});
|
|
18
|
+
function addLineNumbersAndEscapeHtml(code) {
|
|
19
|
+
return code.split("\n").map((line, index) => {
|
|
20
|
+
const escapedLine = escapeHtml(line);
|
|
21
|
+
return `<span class="line-number">${index + 1}</span>${escapedLine}`;
|
|
22
|
+
}).join("\n");
|
|
23
|
+
}
|
|
24
|
+
function escapeHtml(unsafe) {
|
|
25
|
+
return unsafe.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
<svelte:head>
|
|
32
|
+
<!-- Include Prism.js and its CSS theme for syntax highlighting -->
|
|
33
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/prism.min.js"></script>
|
|
34
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/themes/prism-okaidia.min.css" />
|
|
35
|
+
</svelte:head>
|
|
36
|
+
|
|
37
|
+
<div id="outer-container">
|
|
38
|
+
<div id="code-snippet-container">
|
|
39
|
+
<div id="padding-container">
|
|
40
|
+
<div id="title-bar">
|
|
41
|
+
<span id="title">{lang}</span>
|
|
42
|
+
<button id="copy-button" on:click|stopPropagation={copyCode}>
|
|
43
|
+
{#if !copyStatement}
|
|
44
|
+
<CopyIcon />
|
|
45
|
+
{:else}
|
|
46
|
+
<DoneIcon />
|
|
47
|
+
{/if}
|
|
48
|
+
</button>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
<div id="code-content">
|
|
52
|
+
<pre class="language-{lang}"><code id="code-text">{@html formattedCode}</code></pre>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<style>
|
|
58
|
+
#outer-container {
|
|
59
|
+
width: 100%;
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
}
|
|
63
|
+
#code-snippet-container {
|
|
64
|
+
width: 100%; /* Ensure full width */
|
|
65
|
+
margin: 2rem auto; /* Centering the container */
|
|
66
|
+
background-color: #1F2937;
|
|
67
|
+
border-radius: 0.5rem;
|
|
68
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
|
69
|
+
overflow: hidden; /* Hide overflow */
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
#padding-container {
|
|
73
|
+
padding: 1rem;
|
|
74
|
+
background-color: #2c3e50;
|
|
75
|
+
border-top-left-radius: 0.5rem;
|
|
76
|
+
border-top-right-radius: 0.5rem;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
#title-bar {
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
justify-content: space-between;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
#title {
|
|
86
|
+
color: #E5E7EB;
|
|
87
|
+
font-size: 1.25rem;
|
|
88
|
+
font-weight: bold;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
#copy-button {
|
|
92
|
+
display: flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
justify-content: center;
|
|
95
|
+
padding: 0.5rem 1rem;
|
|
96
|
+
color: white;
|
|
97
|
+
background-color: #14B8A6;
|
|
98
|
+
border-radius: 0.25rem;
|
|
99
|
+
transition: background-color 0.3s;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
#copy-button:hover {
|
|
103
|
+
background-color: #0D9488;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
#copy-button:focus {
|
|
107
|
+
outline: none;
|
|
108
|
+
box-shadow: 0 0 0 3px #F87171;
|
|
109
|
+
}
|
|
110
|
+
#code-content {
|
|
111
|
+
position: relative;
|
|
112
|
+
padding: 1rem;
|
|
113
|
+
background-color: #1F2937;
|
|
114
|
+
border-bottom-left-radius: 0.5rem;
|
|
115
|
+
border-bottom-right-radius: 0.5rem;
|
|
116
|
+
overflow: auto; /* Enable scrolling for overflow content */
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
pre {
|
|
120
|
+
margin: 0;
|
|
121
|
+
padding: 0; /* Remove padding to use full width */
|
|
122
|
+
max-height: 500px;
|
|
123
|
+
overflow: auto; /* Scroll for overflow */
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
#code-text {
|
|
127
|
+
font-size: 0.875rem;
|
|
128
|
+
white-space: pre;
|
|
129
|
+
color: #E5E7EB;
|
|
130
|
+
tab-size: 4;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.line-number {
|
|
134
|
+
display: inline-block;
|
|
135
|
+
min-width: 2em;
|
|
136
|
+
text-align: right;
|
|
137
|
+
margin-right: 16px;
|
|
138
|
+
color: #888;
|
|
139
|
+
user-select: none;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@media (max-width: 768px) {
|
|
143
|
+
#title {
|
|
144
|
+
font-size: 1rem;
|
|
145
|
+
}
|
|
146
|
+
#code-text {
|
|
147
|
+
font-size: 0.75rem;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { languages } from '../../utils/consts';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
text: string;
|
|
6
|
+
lang: languages;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {};
|
|
12
|
+
exports?: {};
|
|
13
|
+
bindings?: string;
|
|
14
|
+
};
|
|
15
|
+
export type ViewCodeProps = typeof __propDef.props;
|
|
16
|
+
export type ViewCodeEvents = typeof __propDef.events;
|
|
17
|
+
export type ViewCodeSlots = typeof __propDef.slots;
|
|
18
|
+
export default class ViewCode extends SvelteComponent<ViewCodeProps, ViewCodeEvents, ViewCodeSlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
text: string;
|
|
5
|
+
level: 1 | 2 | 3 | 4;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {};
|
|
11
|
+
exports?: {};
|
|
12
|
+
bindings?: string;
|
|
13
|
+
};
|
|
14
|
+
export type ViewHeaderProps = typeof __propDef.props;
|
|
15
|
+
export type ViewHeaderEvents = typeof __propDef.events;
|
|
16
|
+
export type ViewHeaderSlots = typeof __propDef.slots;
|
|
17
|
+
export default class ViewHeader extends SvelteComponent<ViewHeaderProps, ViewHeaderEvents, ViewHeaderSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script>export let base64;
|
|
2
|
+
export let caption;
|
|
3
|
+
export let name;
|
|
4
|
+
let fallback = base64 == "";
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<div class="imageView">
|
|
8
|
+
{#if fallback}
|
|
9
|
+
<img src='/default.jpg' alt="favicon" />
|
|
10
|
+
{:else}
|
|
11
|
+
<img src={base64} alt="sorry {name} image does not exist" on:error={() => (fallback = true)} />
|
|
12
|
+
{/if}
|
|
13
|
+
<span>{caption}</span>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<style>
|
|
17
|
+
.imageView {
|
|
18
|
+
width: 100%;
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: 8px;
|
|
23
|
+
}
|
|
24
|
+
.imageView img {
|
|
25
|
+
width: 100%;
|
|
26
|
+
aspect-ratio: 2/1;
|
|
27
|
+
border-radius: 8px;
|
|
28
|
+
object-fit: cover;
|
|
29
|
+
object-position: center;
|
|
30
|
+
}
|
|
31
|
+
.imageView span {
|
|
32
|
+
color: var(--textColor);
|
|
33
|
+
font-weight: 600;
|
|
34
|
+
}
|
|
35
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
base64: string;
|
|
5
|
+
caption: string;
|
|
6
|
+
name: string;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {};
|
|
12
|
+
exports?: {};
|
|
13
|
+
bindings?: string;
|
|
14
|
+
};
|
|
15
|
+
export type ViewImageProps = typeof __propDef.props;
|
|
16
|
+
export type ViewImageEvents = typeof __propDef.events;
|
|
17
|
+
export type ViewImageSlots = typeof __propDef.slots;
|
|
18
|
+
export default class ViewImage extends SvelteComponent<ViewImageProps, ViewImageEvents, ViewImageSlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<script>export let items;
|
|
2
|
+
export let type;
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
{#if type == 'ordered'}
|
|
6
|
+
<ol>
|
|
7
|
+
{#each items as item, index}
|
|
8
|
+
<div class="item">
|
|
9
|
+
<span class="index">{index + '.'}</span>
|
|
10
|
+
<li>{item}</li>
|
|
11
|
+
</div>
|
|
12
|
+
{/each}
|
|
13
|
+
</ol>
|
|
14
|
+
{:else}
|
|
15
|
+
<ul>
|
|
16
|
+
{#each items as item}
|
|
17
|
+
<li>{item}</li>
|
|
18
|
+
{/each}
|
|
19
|
+
</ul>
|
|
20
|
+
{/if}
|
|
21
|
+
|
|
22
|
+
<style>
|
|
23
|
+
ul,
|
|
24
|
+
ol {
|
|
25
|
+
color: var(--textColor);
|
|
26
|
+
list-style: none;
|
|
27
|
+
text-transform: capitalize;
|
|
28
|
+
inset: unset;
|
|
29
|
+
width: 100%;
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
gap: 15px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
ul {
|
|
36
|
+
list-style: inside;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
ol .item {
|
|
40
|
+
display: grid;
|
|
41
|
+
grid-template-columns: auto auto;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: start;
|
|
44
|
+
gap: 12px;
|
|
45
|
+
}
|
|
46
|
+
ol .item .index {
|
|
47
|
+
width: 2.2rem;
|
|
48
|
+
height: 2.2rem;
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
justify-content: center;
|
|
52
|
+
border: 2px solid var(--primaryColor);
|
|
53
|
+
border-radius: 50%;
|
|
54
|
+
font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
|
|
55
|
+
}
|
|
56
|
+
ol .item li,
|
|
57
|
+
ul li {
|
|
58
|
+
background-color: color-mix(in srgb, var(--primaryColor) 34%, white 10%);
|
|
59
|
+
padding: 6px;
|
|
60
|
+
border-radius: 4px;
|
|
61
|
+
}
|
|
62
|
+
ol .item:nth-child(even) li,
|
|
63
|
+
ul li:nth-child(even) {
|
|
64
|
+
background-color: color-mix(in srgb, var(--secondaryColor) 34%, white 10%);
|
|
65
|
+
}
|
|
66
|
+
ol .item:nth-child(even) .index {
|
|
67
|
+
border: 2px solid var(--secondaryColor);
|
|
68
|
+
}
|
|
69
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
items: string[];
|
|
5
|
+
type: "ordered" | "unordered";
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {};
|
|
11
|
+
exports?: {};
|
|
12
|
+
bindings?: string;
|
|
13
|
+
};
|
|
14
|
+
export type ViewListProps = typeof __propDef.props;
|
|
15
|
+
export type ViewListEvents = typeof __propDef.events;
|
|
16
|
+
export type ViewListSlots = typeof __propDef.slots;
|
|
17
|
+
export default class ViewList extends SvelteComponent<ViewListProps, ViewListEvents, ViewListSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
text: string;
|
|
5
|
+
};
|
|
6
|
+
events: {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
};
|
|
9
|
+
slots: {};
|
|
10
|
+
exports?: {};
|
|
11
|
+
bindings?: string;
|
|
12
|
+
};
|
|
13
|
+
export type ViewParagraphProps = typeof __propDef.props;
|
|
14
|
+
export type ViewParagraphEvents = typeof __propDef.events;
|
|
15
|
+
export type ViewParagraphSlots = typeof __propDef.slots;
|
|
16
|
+
export default class ViewParagraph extends SvelteComponent<ViewParagraphProps, ViewParagraphEvents, ViewParagraphSlots> {
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script>import CloseQuoteIcon from "../icons/closeQuoteIcon.svelte";
|
|
2
|
+
import OpenQuote from "../icons/openQuoteIcon.svelte";
|
|
3
|
+
export let text;
|
|
4
|
+
export let owner;
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<div class="quote">
|
|
8
|
+
<span class="quoteContent"><OpenQuote />{text}<CloseQuoteIcon /></span>
|
|
9
|
+
<span class="quoteOwner">{owner}</span>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<style>
|
|
13
|
+
.quote {
|
|
14
|
+
width: 100%;
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
color: var(--textColor);
|
|
18
|
+
}
|
|
19
|
+
.quote .quoteOwner {
|
|
20
|
+
align-self: flex-end;
|
|
21
|
+
color: var(--primaryColor);
|
|
22
|
+
text-transform: capitalize;
|
|
23
|
+
font-weight: bold;
|
|
24
|
+
}
|
|
25
|
+
.quote .quoteContent {
|
|
26
|
+
padding-left: 10px;
|
|
27
|
+
font-size: var(--small);
|
|
28
|
+
}
|
|
29
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
text: string;
|
|
5
|
+
owner: string;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {};
|
|
11
|
+
exports?: {};
|
|
12
|
+
bindings?: string;
|
|
13
|
+
};
|
|
14
|
+
export type ViewQuoteProps = typeof __propDef.props;
|
|
15
|
+
export type ViewQuoteEvents = typeof __propDef.events;
|
|
16
|
+
export type ViewQuoteSlots = typeof __propDef.slots;
|
|
17
|
+
export default class ViewQuote extends SvelteComponent<ViewQuoteProps, ViewQuoteEvents, ViewQuoteSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
size: number;
|
|
5
|
+
};
|
|
6
|
+
events: {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
};
|
|
9
|
+
slots: {};
|
|
10
|
+
exports?: {};
|
|
11
|
+
bindings?: string;
|
|
12
|
+
};
|
|
13
|
+
export type ViewSpaceProps = typeof __propDef.props;
|
|
14
|
+
export type ViewSpaceEvents = typeof __propDef.events;
|
|
15
|
+
export type ViewSpaceSlots = typeof __propDef.slots;
|
|
16
|
+
export default class ViewSpace extends SvelteComponent<ViewSpaceProps, ViewSpaceEvents, ViewSpaceSlots> {
|
|
17
|
+
}
|
|
18
|
+
export {};
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { get } from 'svelte/store';
|
|
4
|
+
import { data } from './utils/stores';
|
|
5
|
+
export { default as ValiantRichText } from './components/core/main.svelte';
|
|
6
|
+
|
|
7
|
+
export function getData() {
|
|
8
|
+
return get(data);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function setData(newData) {
|
|
12
|
+
data.set(newData);
|
|
13
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { ComponentType, SvelteComponent } from 'svelte';
|
|
2
|
+
export type blocks = 'image' | 'code' | 'quote' | 'paragraph' | 'header' | 'list' | 'space';
|
|
3
|
+
export type dataBlock = {
|
|
4
|
+
name: 'image';
|
|
5
|
+
id: string;
|
|
6
|
+
data: {
|
|
7
|
+
base64: string;
|
|
8
|
+
name: string;
|
|
9
|
+
caption: string;
|
|
10
|
+
};
|
|
11
|
+
} | {
|
|
12
|
+
name: 'paragraph';
|
|
13
|
+
id: string;
|
|
14
|
+
data: {
|
|
15
|
+
text: string;
|
|
16
|
+
};
|
|
17
|
+
} | {
|
|
18
|
+
name: 'code';
|
|
19
|
+
id: string;
|
|
20
|
+
data: {
|
|
21
|
+
text: string;
|
|
22
|
+
lang: languages;
|
|
23
|
+
};
|
|
24
|
+
} | {
|
|
25
|
+
name: 'quote';
|
|
26
|
+
id: string;
|
|
27
|
+
data: {
|
|
28
|
+
text: string;
|
|
29
|
+
owner: string;
|
|
30
|
+
};
|
|
31
|
+
} | {
|
|
32
|
+
name: 'header';
|
|
33
|
+
id: string;
|
|
34
|
+
data: {
|
|
35
|
+
text: string;
|
|
36
|
+
level: 1 | 2 | 3 | 4;
|
|
37
|
+
};
|
|
38
|
+
} | {
|
|
39
|
+
name: 'space';
|
|
40
|
+
id: string;
|
|
41
|
+
data: {
|
|
42
|
+
size: number;
|
|
43
|
+
};
|
|
44
|
+
} | {
|
|
45
|
+
name: 'list';
|
|
46
|
+
id: string;
|
|
47
|
+
data: {
|
|
48
|
+
items: string[];
|
|
49
|
+
type: 'ordered' | 'unordered';
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export type viewBlocks = [
|
|
53
|
+
{
|
|
54
|
+
name: 'image';
|
|
55
|
+
component: ComponentType<SvelteComponent<{
|
|
56
|
+
base64: string;
|
|
57
|
+
name: string;
|
|
58
|
+
caption: string;
|
|
59
|
+
}>>;
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'quote';
|
|
63
|
+
component: ComponentType<SvelteComponent<{
|
|
64
|
+
text: string;
|
|
65
|
+
owner: string;
|
|
66
|
+
}>>;
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'code';
|
|
70
|
+
component: ComponentType<SvelteComponent<{
|
|
71
|
+
text: string;
|
|
72
|
+
lang: languages;
|
|
73
|
+
}>>;
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: 'header';
|
|
77
|
+
component: ComponentType<SvelteComponent<{
|
|
78
|
+
text: string;
|
|
79
|
+
level: 1 | 2 | 3 | 4;
|
|
80
|
+
}>>;
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'paragraph';
|
|
84
|
+
component: ComponentType<SvelteComponent<{
|
|
85
|
+
text: string;
|
|
86
|
+
}>>;
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: 'list';
|
|
90
|
+
component: ComponentType<SvelteComponent<{
|
|
91
|
+
items: string[];
|
|
92
|
+
type: 'ordered' | 'unordered';
|
|
93
|
+
}>>;
|
|
94
|
+
}
|
|
95
|
+
];
|
|
96
|
+
export type languages = 'typescript' | 'javascript' | 'java' | 'css' | 'json' | 'c' | 'cpp' | 'csharp' | 'python' | 'php' | 'sql' | 'plaintext' | 'yaml' | 'xml' | 'rust' | 'lua' | 'bash' | 'markdown' | 'swift' | 'dart' | 'dockerfile' | 'kotlin' | 'ruby' | 'perl' | 'scala' | 'groovy' | 'haskell' | 'r' | 'erlang' | 'elixir' | 'assembly' | 'powershell' | 'matlab' | 'fortran' | 'pascal' | 'cobol' | 'actionscript' | 'scheme' | 'svelte' | 'html' | 'sass' | 'less' | 'stylus' | 'vue' | 'react' | 'angular' | 'graphql' | 'nodejs' | 'shell' | 'objective-c' | 'fsharp' | 'vbnet' | 'julia' | 'clojure' | 'nim' | 'reason' | 'elm' | 'ocaml' | 'wasm' | 'toml';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|