@placeholderco/placeholder-ui 2.1.1 → 2.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/dist/editors/CodeMirror.svelte +295 -297
- package/dist/editors/tiptap/LinkActionMenu.svelte +6 -1
- package/dist/editors/tiptap/extensions/Alert.js +17 -17
- package/dist/editors/tiptap/extensions/Div.js +19 -19
- package/dist/editors/tiptap/extensions/Span.js +14 -14
- package/dist/editors/tiptap/toolbar/AlertButton.svelte +254 -253
- package/dist/editors/tiptap/toolbar/AlignCenterButton.svelte +11 -11
- package/dist/editors/tiptap/toolbar/AlignJustifyButton.svelte +11 -11
- package/dist/editors/tiptap/toolbar/AlignLeftButton.svelte +11 -11
- package/dist/editors/tiptap/toolbar/AlignRightButton.svelte +11 -11
- package/dist/editors/tiptap/toolbar/BoldButton.svelte +11 -11
- package/dist/editors/tiptap/toolbar/BulletListButton.svelte +11 -11
- package/dist/editors/tiptap/toolbar/CodeButton.svelte +11 -11
- package/dist/editors/tiptap/toolbar/ColorButton.svelte +265 -265
- package/dist/editors/tiptap/toolbar/DocumentButton.svelte +51 -51
- package/dist/editors/tiptap/toolbar/HeadingButton.svelte +21 -21
- package/dist/editors/tiptap/toolbar/HtmlButton.svelte +48 -52
- package/dist/editors/tiptap/toolbar/ImageButton.svelte +35 -39
- package/dist/editors/tiptap/toolbar/ItalicButton.svelte +11 -11
- package/dist/editors/tiptap/toolbar/LinkButton.svelte +249 -249
- package/dist/editors/tiptap/toolbar/OrderedListButton.svelte +11 -11
- package/dist/editors/tiptap/toolbar/RedoButton.svelte +11 -11
- package/dist/editors/tiptap/toolbar/StrikethroughButton.svelte +11 -11
- package/dist/editors/tiptap/toolbar/SubscriptButton.svelte +11 -11
- package/dist/editors/tiptap/toolbar/SuperscriptButton.svelte +11 -11
- package/dist/editors/tiptap/toolbar/TableButton.svelte +231 -224
- package/dist/editors/tiptap/toolbar/ToolbarButton.svelte +59 -65
- package/dist/editors/tiptap/toolbar/UnderlineButton.svelte +11 -11
- package/dist/editors/tiptap/toolbar/UndoButton.svelte +11 -11
- package/dist/form/Autocomplete.svelte +24 -22
- package/dist/form/AutocompleteMulti.svelte +24 -22
- package/dist/form/Checkbox.svelte +4 -4
- package/dist/form/Chips.svelte +15 -7
- package/dist/form/ColorPicker.svelte +5 -20
- package/dist/form/ComboBox.svelte +4 -4
- package/dist/form/ComboBoxItemBuilder.svelte +14 -32
- package/dist/form/ComboBoxMulti.svelte +7 -3
- package/dist/form/CronBuilder.svelte +32 -110
- package/dist/form/DatePicker.svelte +9 -28
- package/dist/form/DateRangePicker.svelte +46 -36
- package/dist/form/DateTimePicker.svelte +11 -30
- package/dist/form/Number.svelte +1 -3
- package/dist/form/RadioGroup.svelte +1 -3
- package/dist/form/Select.svelte +25 -28
- package/dist/form/SelectMulti.svelte +36 -38
- package/dist/form/StringArrayBuilder.svelte +1 -3
- package/dist/form/TextArea.svelte +5 -6
- package/dist/form/Textbox.svelte +10 -4
- package/dist/form/TimePicker.svelte +10 -4
- package/dist/icon/Icon.svelte +5 -1
- package/dist/index.d.ts +147 -146
- package/dist/index.js +78 -77
- package/dist/layout/CustomNavbar.svelte +1 -1
- package/dist/layout/NavbarItemDisplay.svelte +1 -1
- package/dist/layout/NavbarItemView.svelte +3 -1
- package/dist/layout/Sidenav.svelte +1 -1
- package/dist/models/ComboBoxItem.d.ts +4 -4
- package/dist/models/NotifyModel.js +0 -1
- package/dist/theme.svelte.d.ts +1 -1
- package/dist/theme.svelte.js +46 -22
- package/dist/ui/Accordion.svelte +1 -3
- package/dist/ui/Badge.svelte +4 -5
- package/dist/ui/Button.svelte +7 -1
- package/dist/ui/ContextMenu.svelte +5 -11
- package/dist/ui/Dialog.svelte +16 -3
- package/dist/ui/Dialog.svelte.d.ts +7 -1
- package/dist/ui/Dropdown.svelte +21 -10
- package/dist/ui/MultiSortable.svelte +1 -3
- package/dist/ui/Pagination.svelte +2 -2
- package/dist/ui/Popover.svelte +16 -37
- package/dist/ui/ProgressBar.svelte +1 -4
- package/dist/ui/ThemeSwitcher.svelte +2 -1
- package/dist/ui/Tooltip.svelte +1 -37
- package/dist/util/DateFunctions.js +1 -1
- package/dist/util/Floating.d.ts +70 -0
- package/dist/util/Floating.js +321 -0
- package/dist/util/NavigateTo.js +2 -2
- package/dist/util/Transitions.d.ts +1 -1
- package/dist/util/Transitions.js +1 -1
- package/package.json +1 -1
|
@@ -1,257 +1,257 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
2
|
+
import type { Editor } from '@tiptap/core';
|
|
3
|
+
import ToolbarButton from './ToolbarButton.svelte';
|
|
4
|
+
import { iconLink } from '../../../icon/index.js';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
editor: Editor;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let { editor }: Props = $props();
|
|
11
|
+
|
|
12
|
+
let showLinkInput = $state(false);
|
|
13
|
+
let linkUrl = $state('');
|
|
14
|
+
let linkOpenInNewTab = $state(false);
|
|
15
|
+
let linkInputElement: HTMLInputElement | undefined = $state();
|
|
16
|
+
let linkDropdownElement: HTMLDivElement | undefined = $state();
|
|
17
|
+
|
|
18
|
+
const toggleLink = () => {
|
|
19
|
+
const attrs = editor.getAttributes('link');
|
|
20
|
+
linkUrl = attrs?.href || '';
|
|
21
|
+
linkOpenInNewTab = attrs?.target === '_blank';
|
|
22
|
+
showLinkInput = !showLinkInput;
|
|
23
|
+
|
|
24
|
+
if (showLinkInput) {
|
|
25
|
+
setTimeout(() => {
|
|
26
|
+
linkInputElement?.focus();
|
|
27
|
+
linkInputElement?.select();
|
|
28
|
+
}, 0);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const setLink = () => {
|
|
33
|
+
if (linkUrl === '') {
|
|
34
|
+
editor.chain().focus().extendMarkRange('link').unsetLink().run();
|
|
35
|
+
} else {
|
|
36
|
+
const linkAttrs: { href: string; target?: string; rel?: string } = { href: linkUrl };
|
|
37
|
+
if (linkOpenInNewTab) {
|
|
38
|
+
linkAttrs.target = '_blank';
|
|
39
|
+
linkAttrs.rel = 'noopener noreferrer';
|
|
40
|
+
}
|
|
41
|
+
editor.chain().focus().extendMarkRange('link').setLink(linkAttrs).run();
|
|
42
|
+
}
|
|
43
|
+
showLinkInput = false;
|
|
44
|
+
linkUrl = '';
|
|
45
|
+
linkOpenInNewTab = false;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const updateLinkTarget = () => {
|
|
49
|
+
if (!linkUrl) return;
|
|
50
|
+
|
|
51
|
+
const linkAttrs: { href: string; target?: string; rel?: string } = { href: linkUrl };
|
|
52
|
+
if (linkOpenInNewTab) {
|
|
53
|
+
linkAttrs.target = '_blank';
|
|
54
|
+
linkAttrs.rel = 'noopener noreferrer';
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (editor.isActive('link')) {
|
|
58
|
+
editor.chain().focus().extendMarkRange('link').setLink(linkAttrs).run();
|
|
59
|
+
} else if (!editor.state.selection.empty) {
|
|
60
|
+
editor.chain().focus().setLink(linkAttrs).run();
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const removeLink = () => {
|
|
65
|
+
editor.chain().focus().extendMarkRange('link').unsetLink().run();
|
|
66
|
+
showLinkInput = false;
|
|
67
|
+
linkUrl = '';
|
|
68
|
+
linkOpenInNewTab = false;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const handleLinkKeydown = (e: KeyboardEvent) => {
|
|
72
|
+
if (e.key === 'Enter') {
|
|
73
|
+
e.preventDefault();
|
|
74
|
+
setLink();
|
|
75
|
+
} else if (e.key === 'Escape') {
|
|
76
|
+
showLinkInput = false;
|
|
77
|
+
linkUrl = '';
|
|
78
|
+
linkOpenInNewTab = false;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
81
|
</script>
|
|
82
82
|
|
|
83
83
|
<div style="position: relative; display: inline-block;">
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
84
|
+
<ToolbarButton
|
|
85
|
+
icon={iconLink}
|
|
86
|
+
title="Link"
|
|
87
|
+
active={editor.isActive('link')}
|
|
88
|
+
onclick={toggleLink}
|
|
89
|
+
/>
|
|
90
|
+
|
|
91
|
+
{#if showLinkInput}
|
|
92
|
+
<div class="link-dropdown" bind:this={linkDropdownElement}>
|
|
93
|
+
<div class="link-input-row">
|
|
94
|
+
<input
|
|
95
|
+
type="text"
|
|
96
|
+
bind:this={linkInputElement}
|
|
97
|
+
bind:value={linkUrl}
|
|
98
|
+
onkeydown={handleLinkKeydown}
|
|
99
|
+
placeholder="Enter URL"
|
|
100
|
+
class="link-input"
|
|
101
|
+
/>
|
|
102
|
+
<button onclick={setLink} class="link-submit-button" title="Apply">✓</button>
|
|
103
|
+
{#if editor.isActive('link')}
|
|
104
|
+
<button onclick={removeLink} class="link-remove-button" title="Remove Link">✕</button>
|
|
105
|
+
{/if}
|
|
106
|
+
</div>
|
|
107
|
+
<label class="link-checkbox-label">
|
|
108
|
+
<input
|
|
109
|
+
type="checkbox"
|
|
110
|
+
bind:checked={linkOpenInNewTab}
|
|
111
|
+
onchange={updateLinkTarget}
|
|
112
|
+
class="link-checkbox"
|
|
113
|
+
/>
|
|
114
|
+
<span>Open in new tab</span>
|
|
115
|
+
</label>
|
|
116
|
+
</div>
|
|
117
|
+
{/if}
|
|
118
118
|
</div>
|
|
119
119
|
|
|
120
120
|
<style>
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
121
|
+
.link-dropdown {
|
|
122
|
+
position: absolute;
|
|
123
|
+
top: 100%;
|
|
124
|
+
left: 0;
|
|
125
|
+
margin-top: 4px;
|
|
126
|
+
display: flex;
|
|
127
|
+
flex-direction: column;
|
|
128
|
+
gap: 8px;
|
|
129
|
+
padding: 8px;
|
|
130
|
+
background: var(--paper-body-bg);
|
|
131
|
+
border: 1px solid var(--border-color);
|
|
132
|
+
border-radius: 4px;
|
|
133
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
134
|
+
z-index: 1000;
|
|
135
|
+
min-width: 320px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
:global(.dark) .link-dropdown {
|
|
139
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.link-input-row {
|
|
143
|
+
display: flex;
|
|
144
|
+
gap: 4px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.link-input {
|
|
148
|
+
flex: 1;
|
|
149
|
+
padding: 6px 10px;
|
|
150
|
+
border: 1px solid var(--border-color);
|
|
151
|
+
border-radius: 4px;
|
|
152
|
+
font-size: 14px;
|
|
153
|
+
outline: none;
|
|
154
|
+
font-family: inherit;
|
|
155
|
+
background: var(--paper-body-bg);
|
|
156
|
+
color: var(--text-color);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.link-input::placeholder {
|
|
160
|
+
color: var(--placeholder-color);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.link-input:focus {
|
|
164
|
+
border-color: var(--ui-primary);
|
|
165
|
+
box-shadow: 0 0 0 2px rgba(var(--ui-primary-rgbc), 0.1);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
:global(.dark) .link-input:focus {
|
|
169
|
+
border-color: var(--ui-accent);
|
|
170
|
+
box-shadow: 0 0 0 2px rgba(var(--ui-accent-rgbc), 0.1);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.link-checkbox-label {
|
|
174
|
+
display: flex;
|
|
175
|
+
align-items: center;
|
|
176
|
+
gap: 6px;
|
|
177
|
+
font-size: 14px;
|
|
178
|
+
color: var(--text-color);
|
|
179
|
+
cursor: pointer;
|
|
180
|
+
user-select: none;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.link-checkbox {
|
|
184
|
+
width: 16px;
|
|
185
|
+
height: 16px;
|
|
186
|
+
cursor: pointer;
|
|
187
|
+
accent-color: var(--ui-primary);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
:global(.dark) .link-checkbox {
|
|
191
|
+
accent-color: var(--ui-accent);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.link-checkbox-label:hover {
|
|
195
|
+
color: var(--ui-primary);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
:global(.dark) .link-checkbox-label:hover {
|
|
199
|
+
color: var(--ui-accent);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.link-submit-button {
|
|
203
|
+
display: flex;
|
|
204
|
+
align-items: center;
|
|
205
|
+
justify-content: center;
|
|
206
|
+
padding: 6px 12px;
|
|
207
|
+
border: none;
|
|
208
|
+
background: var(--ui-primary);
|
|
209
|
+
color: white;
|
|
210
|
+
border-radius: 4px;
|
|
211
|
+
cursor: pointer;
|
|
212
|
+
font-size: 16px;
|
|
213
|
+
font-weight: bold;
|
|
214
|
+
transition: background 0.15s ease;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.link-submit-button:hover {
|
|
218
|
+
background: var(--ui-tertiary-dark);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
:global(.dark) .link-submit-button {
|
|
222
|
+
background: var(--ui-accent);
|
|
223
|
+
color: var(--ui-primary);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
:global(.dark) .link-submit-button:hover {
|
|
227
|
+
background: var(--ui-accent-dark);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.link-remove-button {
|
|
231
|
+
display: flex;
|
|
232
|
+
align-items: center;
|
|
233
|
+
justify-content: center;
|
|
234
|
+
padding: 6px 12px;
|
|
235
|
+
border: none;
|
|
236
|
+
background: var(--ui-tertiary);
|
|
237
|
+
color: var(--ui-primary);
|
|
238
|
+
border-radius: 4px;
|
|
239
|
+
cursor: pointer;
|
|
240
|
+
font-size: 16px;
|
|
241
|
+
font-weight: bold;
|
|
242
|
+
transition: background 0.15s ease;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.link-remove-button:hover {
|
|
246
|
+
background: var(--ui-tertiary-dark);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
:global(.dark) .link-remove-button {
|
|
250
|
+
background: var(--ui-accent);
|
|
251
|
+
color: var(--ui-primary);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
:global(.dark) .link-remove-button:hover {
|
|
255
|
+
background: var(--ui-accent-dark);
|
|
256
|
+
}
|
|
257
257
|
</style>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { Editor } from '@tiptap/core';
|
|
3
|
+
import ToolbarButton from './ToolbarButton.svelte';
|
|
4
|
+
import { iconListNumbers } from '../../../icon/index.js';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
interface Props {
|
|
7
|
+
editor: Editor;
|
|
8
|
+
}
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
let { editor }: Props = $props();
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
<ToolbarButton
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
icon={iconListNumbers}
|
|
15
|
+
title="Numbered List"
|
|
16
|
+
active={editor.isActive('orderedList')}
|
|
17
|
+
onclick={() => editor.chain().focus().toggleOrderedList().run()}
|
|
18
18
|
/>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { Editor } from '@tiptap/core';
|
|
3
|
+
import ToolbarButton from './ToolbarButton.svelte';
|
|
4
|
+
import { iconArrowForwardUp } from '../../../icon/index.js';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
interface Props {
|
|
7
|
+
editor: Editor;
|
|
8
|
+
}
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
let { editor }: Props = $props();
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
<ToolbarButton
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
icon={iconArrowForwardUp}
|
|
15
|
+
title="Redo"
|
|
16
|
+
disabled={!editor.can().redo()}
|
|
17
|
+
onclick={() => editor.chain().focus().redo().run()}
|
|
18
18
|
/>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { Editor } from '@tiptap/core';
|
|
3
|
+
import ToolbarButton from './ToolbarButton.svelte';
|
|
4
|
+
import { iconStrikethrough } from '../../../icon/index.js';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
interface Props {
|
|
7
|
+
editor: Editor;
|
|
8
|
+
}
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
let { editor }: Props = $props();
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
<ToolbarButton
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
icon={iconStrikethrough}
|
|
15
|
+
title="Strikethrough"
|
|
16
|
+
active={editor.isActive('strike')}
|
|
17
|
+
onclick={() => editor.chain().focus().toggleStrike().run()}
|
|
18
18
|
/>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { Editor } from '@tiptap/core';
|
|
3
|
+
import ToolbarButton from './ToolbarButton.svelte';
|
|
4
|
+
import { iconSubscript } from '../../../icon/index.js';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
interface Props {
|
|
7
|
+
editor: Editor;
|
|
8
|
+
}
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
let { editor }: Props = $props();
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
<ToolbarButton
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
icon={iconSubscript}
|
|
15
|
+
title="Subscript"
|
|
16
|
+
active={editor.isActive('subscript')}
|
|
17
|
+
onclick={() => editor.chain().focus().toggleSubscript().run()}
|
|
18
18
|
/>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { Editor } from '@tiptap/core';
|
|
3
|
+
import ToolbarButton from './ToolbarButton.svelte';
|
|
4
|
+
import { iconSuperscript } from '../../../icon/index.js';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
interface Props {
|
|
7
|
+
editor: Editor;
|
|
8
|
+
}
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
let { editor }: Props = $props();
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
<ToolbarButton
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
icon={iconSuperscript}
|
|
15
|
+
title="Superscript"
|
|
16
|
+
active={editor.isActive('superscript')}
|
|
17
|
+
onclick={() => editor.chain().focus().toggleSuperscript().run()}
|
|
18
18
|
/>
|