@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.
Files changed (80) hide show
  1. package/dist/editors/CodeMirror.svelte +295 -297
  2. package/dist/editors/tiptap/LinkActionMenu.svelte +6 -1
  3. package/dist/editors/tiptap/extensions/Alert.js +17 -17
  4. package/dist/editors/tiptap/extensions/Div.js +19 -19
  5. package/dist/editors/tiptap/extensions/Span.js +14 -14
  6. package/dist/editors/tiptap/toolbar/AlertButton.svelte +254 -253
  7. package/dist/editors/tiptap/toolbar/AlignCenterButton.svelte +11 -11
  8. package/dist/editors/tiptap/toolbar/AlignJustifyButton.svelte +11 -11
  9. package/dist/editors/tiptap/toolbar/AlignLeftButton.svelte +11 -11
  10. package/dist/editors/tiptap/toolbar/AlignRightButton.svelte +11 -11
  11. package/dist/editors/tiptap/toolbar/BoldButton.svelte +11 -11
  12. package/dist/editors/tiptap/toolbar/BulletListButton.svelte +11 -11
  13. package/dist/editors/tiptap/toolbar/CodeButton.svelte +11 -11
  14. package/dist/editors/tiptap/toolbar/ColorButton.svelte +265 -265
  15. package/dist/editors/tiptap/toolbar/DocumentButton.svelte +51 -51
  16. package/dist/editors/tiptap/toolbar/HeadingButton.svelte +21 -21
  17. package/dist/editors/tiptap/toolbar/HtmlButton.svelte +48 -52
  18. package/dist/editors/tiptap/toolbar/ImageButton.svelte +35 -39
  19. package/dist/editors/tiptap/toolbar/ItalicButton.svelte +11 -11
  20. package/dist/editors/tiptap/toolbar/LinkButton.svelte +249 -249
  21. package/dist/editors/tiptap/toolbar/OrderedListButton.svelte +11 -11
  22. package/dist/editors/tiptap/toolbar/RedoButton.svelte +11 -11
  23. package/dist/editors/tiptap/toolbar/StrikethroughButton.svelte +11 -11
  24. package/dist/editors/tiptap/toolbar/SubscriptButton.svelte +11 -11
  25. package/dist/editors/tiptap/toolbar/SuperscriptButton.svelte +11 -11
  26. package/dist/editors/tiptap/toolbar/TableButton.svelte +231 -224
  27. package/dist/editors/tiptap/toolbar/ToolbarButton.svelte +59 -65
  28. package/dist/editors/tiptap/toolbar/UnderlineButton.svelte +11 -11
  29. package/dist/editors/tiptap/toolbar/UndoButton.svelte +11 -11
  30. package/dist/form/Autocomplete.svelte +24 -22
  31. package/dist/form/AutocompleteMulti.svelte +24 -22
  32. package/dist/form/Checkbox.svelte +4 -4
  33. package/dist/form/Chips.svelte +15 -7
  34. package/dist/form/ColorPicker.svelte +5 -20
  35. package/dist/form/ComboBox.svelte +4 -4
  36. package/dist/form/ComboBoxItemBuilder.svelte +14 -32
  37. package/dist/form/ComboBoxMulti.svelte +7 -3
  38. package/dist/form/CronBuilder.svelte +32 -110
  39. package/dist/form/DatePicker.svelte +9 -28
  40. package/dist/form/DateRangePicker.svelte +46 -36
  41. package/dist/form/DateTimePicker.svelte +11 -30
  42. package/dist/form/Number.svelte +1 -3
  43. package/dist/form/RadioGroup.svelte +1 -3
  44. package/dist/form/Select.svelte +25 -28
  45. package/dist/form/SelectMulti.svelte +36 -38
  46. package/dist/form/StringArrayBuilder.svelte +1 -3
  47. package/dist/form/TextArea.svelte +5 -6
  48. package/dist/form/Textbox.svelte +10 -4
  49. package/dist/form/TimePicker.svelte +10 -4
  50. package/dist/icon/Icon.svelte +5 -1
  51. package/dist/index.d.ts +147 -146
  52. package/dist/index.js +78 -77
  53. package/dist/layout/CustomNavbar.svelte +1 -1
  54. package/dist/layout/NavbarItemDisplay.svelte +1 -1
  55. package/dist/layout/NavbarItemView.svelte +3 -1
  56. package/dist/layout/Sidenav.svelte +1 -1
  57. package/dist/models/ComboBoxItem.d.ts +4 -4
  58. package/dist/models/NotifyModel.js +0 -1
  59. package/dist/theme.svelte.d.ts +1 -1
  60. package/dist/theme.svelte.js +46 -22
  61. package/dist/ui/Accordion.svelte +1 -3
  62. package/dist/ui/Badge.svelte +4 -5
  63. package/dist/ui/Button.svelte +7 -1
  64. package/dist/ui/ContextMenu.svelte +5 -11
  65. package/dist/ui/Dialog.svelte +16 -3
  66. package/dist/ui/Dialog.svelte.d.ts +7 -1
  67. package/dist/ui/Dropdown.svelte +21 -10
  68. package/dist/ui/MultiSortable.svelte +1 -3
  69. package/dist/ui/Pagination.svelte +2 -2
  70. package/dist/ui/Popover.svelte +16 -37
  71. package/dist/ui/ProgressBar.svelte +1 -4
  72. package/dist/ui/ThemeSwitcher.svelte +2 -1
  73. package/dist/ui/Tooltip.svelte +1 -37
  74. package/dist/util/DateFunctions.js +1 -1
  75. package/dist/util/Floating.d.ts +70 -0
  76. package/dist/util/Floating.js +321 -0
  77. package/dist/util/NavigateTo.js +2 -2
  78. package/dist/util/Transitions.d.ts +1 -1
  79. package/dist/util/Transitions.js +1 -1
  80. package/package.json +1 -1
@@ -1,258 +1,265 @@
1
1
  <script lang="ts">
2
- import type { Editor } from '@tiptap/core'
3
- import ToolbarButton from './ToolbarButton.svelte'
4
- import { iconTable } from '../../../icon/index.js'
2
+ import type { Editor } from '@tiptap/core';
3
+ import ToolbarButton from './ToolbarButton.svelte';
4
+ import { iconTable } from '../../../icon/index.js';
5
5
 
6
- interface Props {
7
- editor: Editor
8
- }
6
+ interface Props {
7
+ editor: Editor;
8
+ }
9
9
 
10
- let { editor }: Props = $props()
10
+ let { editor }: Props = $props();
11
11
 
12
- let showMenu = $state(false)
13
- let hoverRows = $state(0)
14
- let hoverCols = $state(0)
12
+ let showMenu = $state(false);
13
+ let hoverRows = $state(0);
14
+ let hoverCols = $state(0);
15
15
 
16
- const GRID_SIZE = 6
16
+ const GRID_SIZE = 6;
17
17
 
18
- const toggleMenu = () => {
19
- showMenu = !showMenu
20
- hoverRows = 0
21
- hoverCols = 0
22
- }
18
+ const toggleMenu = () => {
19
+ showMenu = !showMenu;
20
+ hoverRows = 0;
21
+ hoverCols = 0;
22
+ };
23
23
 
24
- const insertTable = (rows: number, cols: number) => {
25
- editor.chain().focus().insertTable({ rows, cols, withHeaderRow: true }).run()
26
- showMenu = false
27
- }
24
+ const insertTable = (rows: number, cols: number) => {
25
+ editor.chain().focus().insertTable({ rows, cols, withHeaderRow: true }).run();
26
+ showMenu = false;
27
+ };
28
28
 
29
- const runCommand = (command: () => boolean) => {
30
- command()
31
- showMenu = false
32
- }
29
+ const runCommand = (command: () => boolean) => {
30
+ command();
31
+ showMenu = false;
32
+ };
33
33
  </script>
34
34
 
35
35
  <div style="position: relative; display: inline-block;">
36
- <ToolbarButton
37
- icon={iconTable}
38
- title="Table"
39
- active={showMenu || editor.isActive('table')}
40
- onclick={toggleMenu}
41
- />
36
+ <ToolbarButton
37
+ icon={iconTable}
38
+ title="Table"
39
+ active={showMenu || editor.isActive('table')}
40
+ onclick={toggleMenu}
41
+ />
42
42
 
43
- {#if showMenu}
44
- <div class="table-menu">
45
- {#if editor.isActive('table')}
46
- <div class="menu-title">Table actions</div>
47
- <button
48
- class="menu-item"
49
- type="button"
50
- onclick={() => runCommand(() => editor.chain().focus().addRowBefore().run())}
51
- >
52
- Add row above
53
- </button>
54
- <button
55
- class="menu-item"
56
- type="button"
57
- onclick={() => runCommand(() => editor.chain().focus().addRowAfter().run())}
58
- >
59
- Add row below
60
- </button>
61
- <button
62
- class="menu-item"
63
- type="button"
64
- onclick={() => runCommand(() => editor.chain().focus().addColumnBefore().run())}
65
- >
66
- Add column left
67
- </button>
68
- <button
69
- class="menu-item"
70
- type="button"
71
- onclick={() => runCommand(() => editor.chain().focus().addColumnAfter().run())}
72
- >
73
- Add column right
74
- </button>
43
+ {#if showMenu}
44
+ <div class="table-menu">
45
+ {#if editor.isActive('table')}
46
+ <div class="menu-title">Table actions</div>
47
+ <button
48
+ class="menu-item"
49
+ type="button"
50
+ onclick={() => runCommand(() => editor.chain().focus().addRowBefore().run())}
51
+ >
52
+ Add row above
53
+ </button>
54
+ <button
55
+ class="menu-item"
56
+ type="button"
57
+ onclick={() => runCommand(() => editor.chain().focus().addRowAfter().run())}
58
+ >
59
+ Add row below
60
+ </button>
61
+ <button
62
+ class="menu-item"
63
+ type="button"
64
+ onclick={() => runCommand(() => editor.chain().focus().addColumnBefore().run())}
65
+ >
66
+ Add column left
67
+ </button>
68
+ <button
69
+ class="menu-item"
70
+ type="button"
71
+ onclick={() => runCommand(() => editor.chain().focus().addColumnAfter().run())}
72
+ >
73
+ Add column right
74
+ </button>
75
75
 
76
- <div class="menu-divider"></div>
76
+ <div class="menu-divider"></div>
77
77
 
78
- <button
79
- class="menu-item"
80
- type="button"
81
- onclick={() => runCommand(() => editor.chain().focus().toggleHeaderRow().run())}
82
- >
83
- Toggle header row
84
- </button>
85
- <button
86
- class="menu-item"
87
- type="button"
88
- disabled={!editor.can().mergeCells()}
89
- onclick={() => runCommand(() => editor.chain().focus().mergeCells().run())}
90
- >
91
- Merge cells
92
- </button>
93
- <button
94
- class="menu-item"
95
- type="button"
96
- disabled={!editor.can().splitCell()}
97
- onclick={() => runCommand(() => editor.chain().focus().splitCell().run())}
98
- >
99
- Split cell
100
- </button>
78
+ <button
79
+ class="menu-item"
80
+ type="button"
81
+ onclick={() => runCommand(() => editor.chain().focus().toggleHeaderRow().run())}
82
+ >
83
+ Toggle header row
84
+ </button>
85
+ <button
86
+ class="menu-item"
87
+ type="button"
88
+ disabled={!editor.can().mergeCells()}
89
+ onclick={() => runCommand(() => editor.chain().focus().mergeCells().run())}
90
+ >
91
+ Merge cells
92
+ </button>
93
+ <button
94
+ class="menu-item"
95
+ type="button"
96
+ disabled={!editor.can().splitCell()}
97
+ onclick={() => runCommand(() => editor.chain().focus().splitCell().run())}
98
+ >
99
+ Split cell
100
+ </button>
101
101
 
102
- <div class="menu-divider"></div>
102
+ <div class="menu-divider"></div>
103
103
 
104
- <button
105
- class="menu-item"
106
- type="button"
107
- onclick={() => runCommand(() => editor.chain().focus().deleteRow().run())}
108
- >
109
- Delete row
110
- </button>
111
- <button
112
- class="menu-item"
113
- type="button"
114
- onclick={() => runCommand(() => editor.chain().focus().deleteColumn().run())}
115
- >
116
- Delete column
117
- </button>
118
- <button
119
- class="menu-item danger"
120
- type="button"
121
- onclick={() => runCommand(() => editor.chain().focus().deleteTable().run())}
122
- >
123
- Delete table
124
- </button>
125
- {:else}
126
- <div class="menu-title">Insert table</div>
127
- <div class="size-grid" onmouseleave={() => { hoverRows = 0; hoverCols = 0 }} role="presentation">
128
- {#each Array(GRID_SIZE) as _, row}
129
- {#each Array(GRID_SIZE) as _, col}
130
- <button
131
- class="size-cell"
132
- class:highlighted={row < hoverRows && col < hoverCols}
133
- type="button"
134
- aria-label="Insert {row + 1} by {col + 1} table"
135
- onmouseenter={() => {
136
- hoverRows = row + 1
137
- hoverCols = col + 1
138
- }}
139
- onclick={() => insertTable(row + 1, col + 1)}
140
- ></button>
141
- {/each}
142
- {/each}
143
- </div>
144
- <div class="size-label">
145
- {hoverRows > 0 ? `${hoverRows} × ${hoverCols}` : 'Select size'}
146
- </div>
147
- {/if}
148
- </div>
149
- {/if}
104
+ <button
105
+ class="menu-item"
106
+ type="button"
107
+ onclick={() => runCommand(() => editor.chain().focus().deleteRow().run())}
108
+ >
109
+ Delete row
110
+ </button>
111
+ <button
112
+ class="menu-item"
113
+ type="button"
114
+ onclick={() => runCommand(() => editor.chain().focus().deleteColumn().run())}
115
+ >
116
+ Delete column
117
+ </button>
118
+ <button
119
+ class="menu-item danger"
120
+ type="button"
121
+ onclick={() => runCommand(() => editor.chain().focus().deleteTable().run())}
122
+ >
123
+ Delete table
124
+ </button>
125
+ {:else}
126
+ <div class="menu-title">Insert table</div>
127
+ <div
128
+ class="size-grid"
129
+ onmouseleave={() => {
130
+ hoverRows = 0;
131
+ hoverCols = 0;
132
+ }}
133
+ role="presentation"
134
+ >
135
+ {#each Array(GRID_SIZE) as _, row}
136
+ {#each Array(GRID_SIZE) as _, col}
137
+ <button
138
+ class="size-cell"
139
+ class:highlighted={row < hoverRows && col < hoverCols}
140
+ type="button"
141
+ aria-label="Insert {row + 1} by {col + 1} table"
142
+ onmouseenter={() => {
143
+ hoverRows = row + 1;
144
+ hoverCols = col + 1;
145
+ }}
146
+ onclick={() => insertTable(row + 1, col + 1)}
147
+ ></button>
148
+ {/each}
149
+ {/each}
150
+ </div>
151
+ <div class="size-label">
152
+ {hoverRows > 0 ? `${hoverRows} × ${hoverCols}` : 'Select size'}
153
+ </div>
154
+ {/if}
155
+ </div>
156
+ {/if}
150
157
  </div>
151
158
 
152
159
  <style>
153
- .table-menu {
154
- position: absolute;
155
- top: 100%;
156
- left: 0;
157
- margin-top: 4px;
158
- display: flex;
159
- flex-direction: column;
160
- gap: 2px;
161
- padding: 8px;
162
- background: var(--paper-body-bg);
163
- border: 1px solid var(--border-color);
164
- border-radius: 6px;
165
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
166
- z-index: 1000;
167
- min-width: 180px;
168
- }
160
+ .table-menu {
161
+ position: absolute;
162
+ top: 100%;
163
+ left: 0;
164
+ margin-top: 4px;
165
+ display: flex;
166
+ flex-direction: column;
167
+ gap: 2px;
168
+ padding: 8px;
169
+ background: var(--paper-body-bg);
170
+ border: 1px solid var(--border-color);
171
+ border-radius: 6px;
172
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
173
+ z-index: 1000;
174
+ min-width: 180px;
175
+ }
169
176
 
170
- :global(.dark) .table-menu {
171
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
172
- }
177
+ :global(.dark) .table-menu {
178
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
179
+ }
173
180
 
174
- .menu-title {
175
- font-size: 11px;
176
- font-weight: 600;
177
- color: var(--text-muted);
178
- text-transform: uppercase;
179
- letter-spacing: 0.05em;
180
- padding: 2px 8px 6px 8px;
181
- }
181
+ .menu-title {
182
+ font-size: 11px;
183
+ font-weight: 600;
184
+ color: var(--text-muted);
185
+ text-transform: uppercase;
186
+ letter-spacing: 0.05em;
187
+ padding: 2px 8px 6px 8px;
188
+ }
182
189
 
183
- .menu-item {
184
- padding: 6px 8px;
185
- border: none;
186
- background: transparent;
187
- color: var(--text-color);
188
- font-size: 13px;
189
- text-align: left;
190
- border-radius: 4px;
191
- cursor: pointer;
192
- transition: background 0.15s ease;
193
- white-space: nowrap;
194
- }
190
+ .menu-item {
191
+ padding: 6px 8px;
192
+ border: none;
193
+ background: transparent;
194
+ color: var(--text-color);
195
+ font-size: 13px;
196
+ text-align: left;
197
+ border-radius: 4px;
198
+ cursor: pointer;
199
+ transition: background 0.15s ease;
200
+ white-space: nowrap;
201
+ }
195
202
 
196
- .menu-item:hover:not(:disabled) {
197
- background: rgba(var(--ui-primary-rgbc), 0.1);
198
- }
203
+ .menu-item:hover:not(:disabled) {
204
+ background: rgba(var(--ui-primary-rgbc), 0.1);
205
+ }
199
206
 
200
- :global(.dark) .menu-item:hover:not(:disabled) {
201
- background: rgba(var(--ui-accent-rgbc), 0.1);
202
- }
207
+ :global(.dark) .menu-item:hover:not(:disabled) {
208
+ background: rgba(var(--ui-accent-rgbc), 0.1);
209
+ }
203
210
 
204
- .menu-item:disabled {
205
- opacity: 0.4;
206
- cursor: not-allowed;
207
- }
211
+ .menu-item:disabled {
212
+ opacity: 0.4;
213
+ cursor: not-allowed;
214
+ }
208
215
 
209
- .menu-item.danger {
210
- color: #dc3545;
211
- }
216
+ .menu-item.danger {
217
+ color: #dc3545;
218
+ }
212
219
 
213
- :global(.dark) .menu-item.danger {
214
- color: #ea868f;
215
- }
220
+ :global(.dark) .menu-item.danger {
221
+ color: #ea868f;
222
+ }
216
223
 
217
- .menu-divider {
218
- height: 1px;
219
- background: var(--border-color);
220
- margin: 4px 0;
221
- }
224
+ .menu-divider {
225
+ height: 1px;
226
+ background: var(--border-color);
227
+ margin: 4px 0;
228
+ }
222
229
 
223
- .size-grid {
224
- display: grid;
225
- grid-template-columns: repeat(6, 20px);
226
- gap: 3px;
227
- padding: 0 8px;
228
- justify-content: center;
229
- }
230
+ .size-grid {
231
+ display: grid;
232
+ grid-template-columns: repeat(6, 20px);
233
+ gap: 3px;
234
+ padding: 0 8px;
235
+ justify-content: center;
236
+ }
230
237
 
231
- .size-cell {
232
- width: 20px;
233
- height: 20px;
234
- padding: 0;
235
- border: 1px solid var(--border-color);
236
- border-radius: 3px;
237
- background: var(--paper-body-bg);
238
- cursor: pointer;
239
- transition: all 0.1s ease;
240
- }
238
+ .size-cell {
239
+ width: 20px;
240
+ height: 20px;
241
+ padding: 0;
242
+ border: 1px solid var(--border-color);
243
+ border-radius: 3px;
244
+ background: var(--paper-body-bg);
245
+ cursor: pointer;
246
+ transition: all 0.1s ease;
247
+ }
241
248
 
242
- .size-cell.highlighted {
243
- background: var(--ui-tertiary);
244
- border-color: var(--ui-tertiary-dark);
245
- }
249
+ .size-cell.highlighted {
250
+ background: var(--ui-tertiary);
251
+ border-color: var(--ui-tertiary-dark);
252
+ }
246
253
 
247
- :global(.dark) .size-cell.highlighted {
248
- background: var(--ui-accent);
249
- border-color: var(--ui-accent-dark);
250
- }
254
+ :global(.dark) .size-cell.highlighted {
255
+ background: var(--ui-accent);
256
+ border-color: var(--ui-accent-dark);
257
+ }
251
258
 
252
- .size-label {
253
- text-align: center;
254
- font-size: 12px;
255
- color: var(--text-muted);
256
- padding: 6px 0 2px 0;
257
- }
259
+ .size-label {
260
+ text-align: center;
261
+ font-size: 12px;
262
+ color: var(--text-muted);
263
+ padding: 6px 0 2px 0;
264
+ }
258
265
  </style>
@@ -1,84 +1,78 @@
1
1
  <script lang="ts">
2
- import { Icon } from '../../../icon/index.js'
2
+ import { Icon } from '../../../icon/index.js';
3
3
 
4
- interface Props {
5
- icon: string
6
- title: string
7
- active?: boolean
8
- disabled?: boolean
9
- onclick: () => void
10
- }
4
+ interface Props {
5
+ icon: string;
6
+ title: string;
7
+ active?: boolean;
8
+ disabled?: boolean;
9
+ onclick: () => void;
10
+ }
11
11
 
12
- let {
13
- icon,
14
- title,
15
- active = false,
16
- disabled = false,
17
- onclick
18
- }: Props = $props()
12
+ let { icon, title, active = false, disabled = false, onclick }: Props = $props();
19
13
  </script>
20
14
 
21
15
  <button
22
- class="toolbar-button"
23
- type="button"
24
- tabindex="-1"
25
- {onclick}
26
- {disabled}
27
- {title}
28
- class:active
16
+ class="toolbar-button"
17
+ type="button"
18
+ tabindex="-1"
19
+ {onclick}
20
+ {disabled}
21
+ {title}
22
+ class:active
29
23
  >
30
- <Icon svg={icon} size="20" />
24
+ <Icon svg={icon} size="20" />
31
25
  </button>
32
26
 
33
27
  <style>
34
- .toolbar-button {
35
- display: flex;
36
- align-items: center;
37
- justify-content: center;
38
- width: 32px;
39
- height: 28px;
40
- padding: 0;
41
- border: none;
42
- background: transparent;
43
- color: var(--text-color);
44
- border-radius: 4px;
45
- cursor: pointer;
46
- transition: all 0.15s ease;
47
- }
28
+ .toolbar-button {
29
+ display: flex;
30
+ align-items: center;
31
+ justify-content: center;
32
+ width: 32px;
33
+ height: 28px;
34
+ padding: 0;
35
+ border: none;
36
+ background: transparent;
37
+ color: var(--text-color);
38
+ border-radius: 4px;
39
+ cursor: pointer;
40
+ transition: all 0.15s ease;
41
+ }
48
42
 
49
- .toolbar-button:hover:not(:disabled) {
50
- background: rgba(var(--ui-primary-rgbc), 0.1);
51
- color: var(--ui-primary);
52
- }
43
+ .toolbar-button:hover:not(:disabled) {
44
+ background: rgba(var(--ui-primary-rgbc), 0.1);
45
+ color: var(--ui-primary);
46
+ }
53
47
 
54
- :global(.dark) .toolbar-button:hover:not(:disabled) {
55
- background: rgba(var(--ui-accent-rgbc), 0.1);
56
- color: var(--ui-accent);
57
- }
48
+ :global(.dark) .toolbar-button:hover:not(:disabled) {
49
+ background: rgba(var(--ui-accent-rgbc), 0.1);
50
+ color: var(--ui-accent);
51
+ }
58
52
 
59
- .toolbar-button:active:not(:disabled) {
60
- background: rgba(var(--ui-primary-rgbc), 0.15);
61
- }
53
+ .toolbar-button:active:not(:disabled) {
54
+ background: rgba(var(--ui-primary-rgbc), 0.15);
55
+ }
62
56
 
63
- :global(.dark) .toolbar-button:active:not(:disabled) {
64
- background: rgba(var(--ui-accent-rgbc), 0.15);
65
- }
57
+ :global(.dark) .toolbar-button:active:not(:disabled) {
58
+ background: rgba(var(--ui-accent-rgbc), 0.15);
59
+ }
66
60
 
67
- .toolbar-button.active {
68
- background: var(--ui-primary);
69
- color: white;
70
- }
61
+ .toolbar-button.active {
62
+ background: var(--ui-primary);
63
+ color: white;
64
+ }
71
65
 
72
- .toolbar-button.active:hover {
73
- background: var(--ui-tertiary-dark);
74
- }
66
+ .toolbar-button.active:hover {
67
+ background: var(--ui-tertiary-dark);
68
+ }
75
69
 
76
- .toolbar-button:disabled {
77
- opacity: 0.4;
78
- cursor: not-allowed;
79
- }
70
+ .toolbar-button:disabled {
71
+ opacity: 0.4;
72
+ cursor: not-allowed;
73
+ }
80
74
 
81
- .toolbar-button :global(.cu-icon) {
82
- height: 19px;
83
- }
75
+ .toolbar-button :global(.cu-icon) {
76
+ height: 19px;
77
+ }
84
78
  </style>
@@ -1,18 +1,18 @@
1
1
  <script lang="ts">
2
- import type { Editor } from '@tiptap/core'
3
- import ToolbarButton from './ToolbarButton.svelte'
4
- import { iconUnderline } from '../../../icon/index.js'
2
+ import type { Editor } from '@tiptap/core';
3
+ import ToolbarButton from './ToolbarButton.svelte';
4
+ import { iconUnderline } from '../../../icon/index.js';
5
5
 
6
- interface Props {
7
- editor: Editor
8
- }
6
+ interface Props {
7
+ editor: Editor;
8
+ }
9
9
 
10
- let { editor }: Props = $props()
10
+ let { editor }: Props = $props();
11
11
  </script>
12
12
 
13
13
  <ToolbarButton
14
- icon={iconUnderline}
15
- title="Underline"
16
- active={editor.isActive('underline')}
17
- onclick={() => editor.chain().focus().toggleUnderline().run()}
14
+ icon={iconUnderline}
15
+ title="Underline"
16
+ active={editor.isActive('underline')}
17
+ onclick={() => editor.chain().focus().toggleUnderline().run()}
18
18
  />