@placeholderco/placeholder-ui 2.1.1 → 2.2.1
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/app.css +0 -10
- package/dist/editors/CodeMirror.svelte +295 -297
- package/dist/editors/tiptap/LinkActionMenu.svelte +6 -1
- package/dist/editors/tiptap/TipTap.svelte +1 -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 -54
- 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 +8 -4
- package/dist/index.d.ts +147 -146
- package/dist/index.js +78 -77
- package/dist/layout/CustomNavbar.svelte +1 -1
- package/dist/layout/Navbar.svelte +3 -4
- package/dist/layout/Navbar.svelte.d.ts +1 -2
- 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/AccordionItem.svelte +8 -16
- package/dist/ui/Badge.svelte +11 -19
- package/dist/ui/Button.svelte +15 -17
- package/dist/ui/ButtonVariant.d.ts +1 -7
- package/dist/ui/ContextMenu.svelte +5 -11
- package/dist/ui/Dialog.svelte +74 -30
- package/dist/ui/Dialog.svelte.d.ts +8 -2
- 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 +4 -10
- package/dist/ui/ProgressBarVariant.d.ts +2 -7
- 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,261 +1,262 @@
|
|
|
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
|
-
|
|
2
|
+
import type { Editor } from '@tiptap/core';
|
|
3
|
+
import ToolbarButton from './ToolbarButton.svelte';
|
|
4
|
+
import { iconAlertTriangle } from '../../../icon/index.js';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
editor: Editor;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let { editor }: Props = $props();
|
|
11
|
+
|
|
12
|
+
let showDialog = $state(false);
|
|
13
|
+
let dialogElement: HTMLDivElement | undefined = $state();
|
|
14
|
+
let titleInputElement: HTMLInputElement | undefined = $state();
|
|
15
|
+
let selectedVariant = $state('default');
|
|
16
|
+
let alertTitle = $state('Alert');
|
|
17
|
+
|
|
18
|
+
const variants = [
|
|
19
|
+
{ value: 'default', label: 'Default', color: 'var(--ui-accent)' },
|
|
20
|
+
{ value: 'warning', label: 'Warning', color: '#ffc107' },
|
|
21
|
+
{ value: 'danger', label: 'Danger', color: '#dc3545' }
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
const toggleDialog = () => {
|
|
25
|
+
showDialog = !showDialog;
|
|
26
|
+
if (showDialog) {
|
|
27
|
+
// Focus and select the title input when dialog opens
|
|
28
|
+
setTimeout(() => {
|
|
29
|
+
titleInputElement?.focus();
|
|
30
|
+
titleInputElement?.select();
|
|
31
|
+
}, 0);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const insertAlert = () => {
|
|
36
|
+
editor
|
|
37
|
+
.chain()
|
|
38
|
+
.focus()
|
|
39
|
+
.setAlert({
|
|
40
|
+
variant: selectedVariant,
|
|
41
|
+
title: alertTitle || 'Alert'
|
|
42
|
+
})
|
|
43
|
+
.run();
|
|
44
|
+
|
|
45
|
+
showDialog = false;
|
|
46
|
+
// Reset to defaults
|
|
47
|
+
selectedVariant = 'default';
|
|
48
|
+
alertTitle = 'Alert';
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const closeDialog = () => {
|
|
52
|
+
showDialog = false;
|
|
53
|
+
selectedVariant = 'default';
|
|
54
|
+
alertTitle = 'Alert';
|
|
55
|
+
};
|
|
56
56
|
</script>
|
|
57
57
|
|
|
58
58
|
<div style="position: relative; display: inline-block;">
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
|
|
59
|
+
<ToolbarButton
|
|
60
|
+
icon={iconAlertTriangle}
|
|
61
|
+
title="Insert Alert"
|
|
62
|
+
active={showDialog}
|
|
63
|
+
onclick={toggleDialog}
|
|
64
|
+
/>
|
|
65
|
+
|
|
66
|
+
{#if showDialog}
|
|
67
|
+
<div class="alert-dialog" bind:this={dialogElement}>
|
|
68
|
+
<div class="dialog-header">
|
|
69
|
+
<h4>Insert Alert</h4>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<div class="dialog-body">
|
|
73
|
+
<div class="form-group">
|
|
74
|
+
<label for="alert-title">Title</label>
|
|
75
|
+
<input
|
|
76
|
+
id="alert-title"
|
|
77
|
+
type="text"
|
|
78
|
+
bind:this={titleInputElement}
|
|
79
|
+
bind:value={alertTitle}
|
|
80
|
+
placeholder="Enter alert title"
|
|
81
|
+
class="form-input"
|
|
82
|
+
/>
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<div class="form-group">
|
|
86
|
+
<label for="alert-variants">Variant</label>
|
|
87
|
+
<div
|
|
88
|
+
id="alert-variants"
|
|
89
|
+
class="variant-grid"
|
|
90
|
+
role="group"
|
|
91
|
+
aria-label="Alert variant selection"
|
|
92
|
+
>
|
|
93
|
+
{#each variants as variant}
|
|
94
|
+
<button
|
|
95
|
+
class="variant-button"
|
|
96
|
+
class:active={selectedVariant === variant.value}
|
|
97
|
+
style="border-left: 4px solid {variant.color}"
|
|
98
|
+
onclick={() => (selectedVariant = variant.value)}
|
|
99
|
+
type="button"
|
|
100
|
+
>
|
|
101
|
+
{variant.label}
|
|
102
|
+
</button>
|
|
103
|
+
{/each}
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<div class="dialog-footer">
|
|
109
|
+
<button class="btn btn-secondary" onclick={closeDialog} type="button"> Cancel </button>
|
|
110
|
+
<button class="btn btn-primary" onclick={insertAlert} type="button"> Insert </button>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
{/if}
|
|
113
114
|
</div>
|
|
114
115
|
|
|
115
116
|
<style>
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
117
|
+
.alert-dialog {
|
|
118
|
+
position: absolute;
|
|
119
|
+
top: 100%;
|
|
120
|
+
right: 0;
|
|
121
|
+
margin-top: 4px;
|
|
122
|
+
display: flex;
|
|
123
|
+
flex-direction: column;
|
|
124
|
+
background: var(--paper-body-bg);
|
|
125
|
+
border: 1px solid var(--border-color);
|
|
126
|
+
border-radius: 6px;
|
|
127
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
128
|
+
z-index: 1000;
|
|
129
|
+
min-width: 300px;
|
|
130
|
+
max-width: 350px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
:global(.dark) .alert-dialog {
|
|
134
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.dialog-header {
|
|
138
|
+
padding: 12px 16px;
|
|
139
|
+
border-bottom: 1px solid var(--border-color);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.dialog-header h4 {
|
|
143
|
+
margin: 0;
|
|
144
|
+
font-size: 14px;
|
|
145
|
+
font-weight: 600;
|
|
146
|
+
color: var(--text-color);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.dialog-body {
|
|
150
|
+
padding: 16px;
|
|
151
|
+
display: flex;
|
|
152
|
+
flex-direction: column;
|
|
153
|
+
gap: 16px;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.form-group {
|
|
157
|
+
display: flex;
|
|
158
|
+
flex-direction: column;
|
|
159
|
+
gap: 8px;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.form-group label {
|
|
163
|
+
font-size: 12px;
|
|
164
|
+
font-weight: 600;
|
|
165
|
+
color: var(--text-color);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.form-input {
|
|
169
|
+
padding: 8px 12px;
|
|
170
|
+
border: 1px solid var(--border-color);
|
|
171
|
+
border-radius: 4px;
|
|
172
|
+
background: var(--input-bg);
|
|
173
|
+
color: var(--text-color);
|
|
174
|
+
font-size: 13px;
|
|
175
|
+
font-family: inherit;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.form-input:focus {
|
|
179
|
+
outline: none;
|
|
180
|
+
border-color: var(--ui-primary);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
:global(.dark) .form-input:focus {
|
|
184
|
+
border-color: var(--ui-accent);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.variant-grid {
|
|
188
|
+
display: flex;
|
|
189
|
+
flex-direction: column;
|
|
190
|
+
gap: 8px;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.variant-button {
|
|
194
|
+
width: 100%;
|
|
195
|
+
padding: 10px 12px;
|
|
196
|
+
border: 1px solid var(--border-color);
|
|
197
|
+
border-radius: 4px;
|
|
198
|
+
background: var(--paper-body-bg);
|
|
199
|
+
color: var(--text-color);
|
|
200
|
+
font-size: 13px;
|
|
201
|
+
font-weight: 500;
|
|
202
|
+
cursor: pointer;
|
|
203
|
+
transition: all 0.15s ease;
|
|
204
|
+
text-align: left;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.variant-button:hover {
|
|
208
|
+
background: var(--page-bg);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.variant-button.active {
|
|
212
|
+
background: var(--page-bg);
|
|
213
|
+
border-color: var(--ui-primary);
|
|
214
|
+
font-weight: 600;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
:global(.dark) .variant-button.active {
|
|
218
|
+
border-color: var(--ui-accent);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.dialog-footer {
|
|
222
|
+
padding: 12px 16px;
|
|
223
|
+
border-top: 1px solid var(--border-color);
|
|
224
|
+
display: flex;
|
|
225
|
+
gap: 8px;
|
|
226
|
+
justify-content: flex-end;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.btn {
|
|
230
|
+
padding: 6px 16px;
|
|
231
|
+
border: none;
|
|
232
|
+
border-radius: 4px;
|
|
233
|
+
font-size: 13px;
|
|
234
|
+
font-weight: 500;
|
|
235
|
+
cursor: pointer;
|
|
236
|
+
transition: all 0.15s ease;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.btn-secondary {
|
|
240
|
+
background: var(--page-bg);
|
|
241
|
+
color: var(--text-color);
|
|
242
|
+
border: 1px solid var(--border-color);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.btn-secondary:hover {
|
|
246
|
+
background: var(--border-color);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.btn-primary {
|
|
250
|
+
background: var(--ui-primary);
|
|
251
|
+
color: var(--off-white);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.btn-primary:hover {
|
|
255
|
+
opacity: 0.9;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
:global(.dark) .btn-primary {
|
|
259
|
+
background: var(--ui-accent);
|
|
260
|
+
color: var(--ui-primary);
|
|
261
|
+
}
|
|
261
262
|
</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 { iconAlignCenter } 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={iconAlignCenter}
|
|
15
|
+
title="Align Center"
|
|
16
|
+
active={editor.isActive({ textAlign: 'center' })}
|
|
17
|
+
onclick={() => editor.chain().focus().setTextAlign('center').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 { iconAlignJustified } 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={iconAlignJustified}
|
|
15
|
+
title="Justify"
|
|
16
|
+
active={editor.isActive({ textAlign: 'justify' })}
|
|
17
|
+
onclick={() => editor.chain().focus().setTextAlign('justify').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 { iconAlignLeft } 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={iconAlignLeft}
|
|
15
|
+
title="Align Left"
|
|
16
|
+
active={editor.isActive({ textAlign: 'left' })}
|
|
17
|
+
onclick={() => editor.chain().focus().setTextAlign('left').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 { iconAlignRight } 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={iconAlignRight}
|
|
15
|
+
title="Align Right"
|
|
16
|
+
active={editor.isActive({ textAlign: 'right' })}
|
|
17
|
+
onclick={() => editor.chain().focus().setTextAlign('right').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 { iconBold } 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={iconBold}
|
|
15
|
+
title="Bold"
|
|
16
|
+
active={editor.isActive('bold')}
|
|
17
|
+
onclick={() => editor.chain().focus().toggleBold().run()}
|
|
18
18
|
/>
|