@sveltia/ui 0.15.12 → 0.15.14

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 (33) hide show
  1. package/package/components/button/button.svelte +1 -1
  2. package/package/components/button/button.svelte.d.ts +4 -4
  3. package/package/components/button/split-button.svelte +1 -1
  4. package/package/components/button/split-button.svelte.d.ts +2 -2
  5. package/package/components/menu/menu-button.svelte +1 -1
  6. package/package/components/menu/menu-button.svelte.d.ts +2 -2
  7. package/package/components/select/combobox.svelte +1 -1
  8. package/package/components/select/combobox.svelte.d.ts +2 -2
  9. package/package/components/text-editor/core.js +2 -2
  10. package/package/components/text-editor/index.d.ts +6 -6
  11. package/package/components/text-editor/index.js +3 -3
  12. package/package/components/text-editor/lexical-root.svelte +10 -7
  13. package/package/components/text-editor/text-editor.svelte +19 -8
  14. package/package/components/text-editor/text-editor.svelte.d.ts +4 -4
  15. package/package/components/text-editor/toolbar/editor-toolbar.svelte +11 -16
  16. package/package/components/text-editor/toolbar/format-text-button.svelte +2 -2
  17. package/package/components/text-editor/toolbar/format-text-button.svelte.d.ts +2 -2
  18. package/package/components/text-editor/toolbar/insert-link-button.svelte +13 -5
  19. package/package/components/text-editor/toolbar/toggle-block-menu-item.svelte +2 -2
  20. package/package/components/text-editor/toolbar/toggle-block-menu-item.svelte.d.ts +2 -2
  21. package/package/components/toast/toast.svelte +1 -1
  22. package/package/components/toast/toast.svelte.d.ts +2 -2
  23. package/package/components/util/app-shell.svelte +491 -2
  24. package/package/components/util/popup.svelte +1 -1
  25. package/package/components/util/popup.svelte.d.ts +4 -4
  26. package/package/index.d.ts +1 -0
  27. package/package/index.js +3 -0
  28. package/package/services/events.js +22 -9
  29. package/package/services/popup.d.ts +3 -3
  30. package/package/services/popup.js +7 -3
  31. package/package/{typedef.d.ts → typedefs.d.ts} +7 -7
  32. package/package/{typedef.js → typedefs.js} +2 -0
  33. package/package.json +28 -607
@@ -6,7 +6,6 @@
6
6
  -->
7
7
  <script>
8
8
  import { onMount } from 'svelte';
9
- import '../../styles/core.scss';
10
9
 
11
10
  /**
12
11
  * Orientation of the app shell’s children.
@@ -87,7 +86,497 @@
87
86
  <slot />
88
87
  </div>
89
88
 
90
- <style global>:global(.font-loader) {
89
+ <style global>@import url("https://fonts.googleapis.com/css2?family=Merriweather+Sans:ital,wght@0,300;0,600;1,300;1,600&family=Noto+Sans+Mono&display=swap");
90
+ @import url("https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=block");
91
+ :global(:root),
92
+ :global(:host) {
93
+ --sui-base-hue: 210;
94
+ --sui-highlight-foreground-color: hsl(var(--sui-foreground-color-1-hsl));
95
+ --sui-primary-foreground-color: hsl(var(--sui-foreground-color-2-hsl));
96
+ --sui-secondary-foreground-color: hsl(var(--sui-foreground-color-3-hsl));
97
+ --sui-tertiary-foreground-color: hsl(var(--sui-foreground-color-4-hsl));
98
+ --sui-disabled-foreground-color: hsl(var(--sui-foreground-color-5-hsl));
99
+ --sui-error-foreground-color: hsl(
100
+ var(--sui-error-color-hue) var(--sui-alert-foreground-color-saturation)
101
+ var(--sui-alert-foreground-color-lightness)
102
+ );
103
+ --sui-warning-foreground-color: hsl(
104
+ var(--sui-warning-color-hue) var(--sui-alert-foreground-color-saturation)
105
+ var(--sui-alert-foreground-color-lightness)
106
+ );
107
+ --sui-info-foreground-color: hsl(
108
+ var(--sui-info-color-hue) var(--sui-alert-foreground-color-saturation)
109
+ var(--sui-alert-foreground-color-lightness)
110
+ );
111
+ --sui-success-foreground-color: hsl(
112
+ var(--sui-success-color-hue) var(--sui-alert-foreground-color-saturation)
113
+ var(--sui-alert-foreground-color-lightness)
114
+ );
115
+ --sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 35%);
116
+ --sui-selected-background-color: hsl(var(--sui-background-color-5-hsl) / 75%);
117
+ --sui-active-background-color: hsl(var(--sui-background-color-5-hsl) / 100%);
118
+ --sui-content-background-color: hsl(var(--sui-background-color-1-hsl));
119
+ --sui-code-background-color: hsl(var(--sui-background-color-4-hsl));
120
+ --sui-primary-background-color: hsl(var(--sui-background-color-2-hsl));
121
+ --sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl) / 80%);
122
+ --sui-secondary-background-color: hsl(var(--sui-background-color-3-hsl));
123
+ --sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl) / 80%);
124
+ --sui-tertiary-background-color: hsl(var(--sui-background-color-4-hsl));
125
+ --sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl) / 80%);
126
+ --sui-disabled-background-color: hsl(var(--sui-background-color-4-hsl));
127
+ --sui-error-background-color: hsl(
128
+ var(--sui-error-color-hue) var(--sui-alert-background-color-saturation)
129
+ var(--sui-alert-background-color-lightness)
130
+ );
131
+ --sui-warning-background-color: hsl(
132
+ var(--sui-warning-color-hue) var(--sui-alert-background-color-saturation)
133
+ var(--sui-alert-background-color-lightness)
134
+ );
135
+ --sui-info-background-color: hsl(
136
+ var(--sui-info-color-hue) var(--sui-alert-background-color-saturation)
137
+ var(--sui-alert-background-color-lightness)
138
+ );
139
+ --sui-success-background-color: hsl(
140
+ var(--sui-success-color-hue) var(--sui-alert-background-color-saturation)
141
+ var(--sui-alert-background-color-lightness)
142
+ );
143
+ --sui-focus-ring-width: 4px;
144
+ --sui-primary-border-color: hsl(var(--sui-border-color-2-hsl));
145
+ --sui-secondary-border-color: hsl(var(--sui-border-color-3-hsl));
146
+ --sui-error-border-color: hsl(
147
+ var(--sui-error-color-hue) var(--sui-alert-border-color-saturation)
148
+ var(--sui-alert-border-color-lightness)
149
+ );
150
+ --sui-warning-border-color: hsl(
151
+ var(--sui-warning-color-hue) var(--sui-alert-border-color-saturation)
152
+ var(--sui-alert-border-color-lightness)
153
+ );
154
+ --sui-info-border-color: hsl(
155
+ var(--sui-info-color-hue) var(--sui-alert-border-color-saturation)
156
+ var(--sui-alert-border-color-lightness)
157
+ );
158
+ --sui-success-border-color: hsl(
159
+ var(--sui-success-color-hue) var(--sui-alert-border-color-saturation)
160
+ var(--sui-alert-border-color-lightness)
161
+ );
162
+ --sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 40%);
163
+ --sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 40%);
164
+ --sui-font-family-default: "Merriweather Sans", sans-serif;
165
+ --sui-font-size-xxx-large: 24px;
166
+ --sui-font-size-xx-large: 20px;
167
+ --sui-font-size-x-large: 18px;
168
+ --sui-font-size-large: 16px;
169
+ --sui-font-size-default: 14px;
170
+ --sui-font-size-small: 12px;
171
+ --sui-font-size-x-small: 10px;
172
+ --sui-font-weight-normal: 300;
173
+ --sui-font-weight-bold: 600;
174
+ --sui-font-family-monospace: "Noto Sans Mono", monospace;
175
+ --sui-font-size-monospace: 0.9em;
176
+ --sui-line-height-default: 1.25;
177
+ --sui-line-height-compact: 1.5;
178
+ --sui-line-height-comfortable: 1.75;
179
+ --sui-word-spacing-normal: 0.1ex;
180
+ --sui-control-small-border-width: 1px;
181
+ --sui-control-small-border-radius: calc(var(--sui-control-small-height) / 8);
182
+ --sui-control-small-padding: 0 calc((var(--sui-control-small-height) / 5));
183
+ --sui-control-small-height: 24px;
184
+ --sui-control-medium-border-width: 1px;
185
+ --sui-control-medium-border-radius: calc(var(--sui-control-medium-height) / 8);
186
+ --sui-control-medium-padding: 0 calc((var(--sui-control-medium-height) / 4));
187
+ --sui-control-medium-height: 32px;
188
+ --sui-control-large-border-width: 1px;
189
+ --sui-control-large-border-radius: calc(var(--sui-control-large-height) / 8);
190
+ --sui-control-large-padding: 0 calc((var(--sui-control-large-height) / 3));
191
+ --sui-control-large-height: 48px;
192
+ --sui-control-border-color: hsl(var(--sui-border-color-2-hsl));
193
+ --sui-control-foreground-color: var(--sui-primary-foreground-color);
194
+ --sui-control-background-color: hsl(var(--sui-background-color-4-hsl));
195
+ --sui-control-font-family: var(--sui-font-family-default);
196
+ --sui-control-font-size: var(--sui-font-size-default);
197
+ --sui-control-line-height: var(--sui-line-height-compact);
198
+ --sui-button-small-border-radius: var(--sui-control-small-border-radius);
199
+ --sui-button-small-padding: var(--sui-control-small-padding);
200
+ --sui-button-small-height: var(--sui-control-small-height);
201
+ --sui-button-medium-border-radius: var(--sui-control-medium-border-radius);
202
+ --sui-button-medium-padding: var(--sui-control-medium-padding);
203
+ --sui-button-medium-height: var(--sui-control-medium-height);
204
+ --sui-button-large-border-radius: var(--sui-control-large-border-radius);
205
+ --sui-button-large-padding: var(--sui-control-large-padding);
206
+ --sui-button-large-height: var(--sui-control-large-height);
207
+ --sui-button-border-color: var(--sui-control-border-color);
208
+ --sui-button-background-color: var(--sui-control-background-color);
209
+ --sui-checkbox-border-radius: var(--sui-control-medium-border-radius);
210
+ --sui-checkbox-height: 20px;
211
+ --sui-checkbox-border-color: hsl(var(--sui-border-color-1-hsl));
212
+ --sui-checkbox-background-color: var(--sui-control-background-color);
213
+ --sui-option-border-radius: var(--sui-control-medium-border-radius);
214
+ --sui-option-padding: calc((var(--sui-control-medium-height) / 6))
215
+ calc((var(--sui-control-medium-height) / 2));
216
+ --sui-option-height: var(--sui-control-medium-height);
217
+ --sui-listbox-border-radius: var(--sui-control-medium-border-radius);
218
+ --sui-listbox-border-color: var(--sui-control-border-color);
219
+ --sui-listbox-foreground-color: var(--sui-control-foreground-color);
220
+ --sui-listbox-background-color: hsl(var(--sui-background-color-1-hsl));
221
+ --sui-textbox-border-radius: var(--sui-control-medium-border-radius);
222
+ --sui-textbox-height: var(--sui-control-medium-height);
223
+ --sui-textbox-border-color: var(--sui-control-border-color);
224
+ --sui-textbox-foreground-color: var(--sui-control-foreground-color);
225
+ --sui-textbox-background-color: hsl(var(--sui-background-color-1-hsl));
226
+ --sui-textbox-font-family: var(--sui-font-family-default);
227
+ --sui-textbox-font-size: var(--sui-font-size-default);
228
+ --sui-textbox-singleline-padding: 0 8px;
229
+ --sui-textbox-singleline-min-width: 240px;
230
+ --sui-textbox-singleline-line-height: var(--sui-line-height-compact);
231
+ --sui-textbox-multiline-padding: 12px;
232
+ --sui-textbox-multiline-min-width: 480px;
233
+ --sui-textbox-multiline-line-height: var(--sui-line-height-comfortable);
234
+ --sui-tab-height: var(--sui-control-medium-height);
235
+ --sui-tab-small-height: var(--sui-control-small-height);
236
+ --sui-tab-medium-height: var(--sui-control-medium-height);
237
+ --sui-tab-large-height: var(--sui-control-large-height);
238
+ --sui-primary-toolbar-size: 48px;
239
+ --sui-secondary-toolbar-size: 40px;
240
+ --sui-primary-row-height: 48px;
241
+ --sui-secondary-row-height: 40px;
242
+ }
243
+
244
+ @media (pointer: coarse) {
245
+ :global(:root),
246
+ :global(:host) {
247
+ --sui-control-small-height: 30px;
248
+ --sui-control-medium-height: 40px;
249
+ --sui-control-large-height: 60px;
250
+ --sui-checkbox-height: 24px;
251
+ --sui-primary-toolbar-size: 56px;
252
+ --sui-secondary-toolbar-size: 48px;
253
+ --sui-primary-row-height: 56px;
254
+ --sui-secondary-row-height: 48px;
255
+ }
256
+ }
257
+ @media (prefers-reduced-transparency) {
258
+ :global(:root),
259
+ :global(:host) {
260
+ --sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));
261
+ --sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));
262
+ --sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));
263
+ }
264
+ }
265
+ :global(:root[data-theme=light]),
266
+ :global(:host[data-theme=light]) {
267
+ color-scheme: light;
268
+ --sui-foreground-color-1-hsl: var(--sui-base-hue) 5% 5%;
269
+ --sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 25%;
270
+ --sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 35%;
271
+ --sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 45%;
272
+ --sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 65%;
273
+ --sui-background-color-1-hsl: var(--sui-base-hue) 5% 100%;
274
+ --sui-background-color-2-hsl: var(--sui-base-hue) 5% 98%;
275
+ --sui-background-color-3-hsl: var(--sui-base-hue) 5% 96%;
276
+ --sui-background-color-4-hsl: var(--sui-base-hue) 5% 94%;
277
+ --sui-background-color-5-hsl: var(--sui-base-hue) 5% 84%;
278
+ --sui-border-color-1-hsl: var(--sui-base-hue) 5% 65%;
279
+ --sui-border-color-2-hsl: var(--sui-base-hue) 5% 84%;
280
+ --sui-border-color-3-hsl: var(--sui-base-hue) 5% 88%;
281
+ --sui-shadow-color: var(--sui-base-hue) 10% 0%;
282
+ --sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 40%);
283
+ --sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 45%);
284
+ --sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 40%);
285
+ --sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 35%);
286
+ --sui-primary-accent-color-inverted: hsl(var(--sui-base-hue) 10% 100%);
287
+ --sui-primary-accent-color-translucent: hsl(var(--sui-base-hue) 80% 50% / 40%);
288
+ --sui-error-color-hue: 0;
289
+ --sui-warning-color-hue: 40;
290
+ --sui-info-color-hue: 210;
291
+ --sui-success-color-hue: 100;
292
+ --sui-alert-foreground-color-saturation: 85%;
293
+ --sui-alert-foreground-color-lightness: 25%;
294
+ --sui-alert-background-color-saturation: 65%;
295
+ --sui-alert-background-color-lightness: 90%;
296
+ --sui-alert-border-color-saturation: 48%;
297
+ --sui-alert-border-color-lightness: 68%;
298
+ }
299
+
300
+ :global(:root[data-theme=dark]),
301
+ :global(:host[data-theme=dark]) {
302
+ color-scheme: dark;
303
+ --sui-foreground-color-1-hsl: var(--sui-base-hue) 10% 95%;
304
+ --sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 75%;
305
+ --sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 65%;
306
+ --sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 55%;
307
+ --sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 35%;
308
+ --sui-background-color-1-hsl: var(--sui-base-hue) 10% 10%;
309
+ --sui-background-color-2-hsl: var(--sui-base-hue) 10% 12%;
310
+ --sui-background-color-3-hsl: var(--sui-base-hue) 10% 14%;
311
+ --sui-background-color-4-hsl: var(--sui-base-hue) 10% 16%;
312
+ --sui-background-color-5-hsl: var(--sui-base-hue) 10% 26%;
313
+ --sui-border-color-1-hsl: var(--sui-base-hue) 10% 45%;
314
+ --sui-border-color-2-hsl: var(--sui-base-hue) 10% 26%;
315
+ --sui-border-color-3-hsl: var(--sui-base-hue) 10% 22%;
316
+ --sui-shadow-color: var(--sui-base-hue) 10% 0%;
317
+ --sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 60%);
318
+ --sui-primary-accent-color-light: hsl(var(--sui-base-hue) 100% 45%);
319
+ --sui-primary-accent-color: hsl(var(--sui-base-hue) 100% 40%);
320
+ --sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 100% 35%);
321
+ --sui-primary-accent-color-inverted: hsl(var(--sui-base-hue) 10% 100%);
322
+ --sui-primary-accent-color-translucent: hsl(var(--sui-base-hue) 80% 50% / 40%);
323
+ --sui-error-color-hue: 0;
324
+ --sui-warning-color-hue: 40;
325
+ --sui-info-color-hue: 210;
326
+ --sui-success-color-hue: 100;
327
+ --sui-alert-foreground-color-saturation: 85%;
328
+ --sui-alert-foreground-color-lightness: 75%;
329
+ --sui-alert-background-color-saturation: 40%;
330
+ --sui-alert-background-color-lightness: 10%;
331
+ --sui-alert-border-color-saturation: 38%;
332
+ --sui-alert-border-color-lightness: 18%;
333
+ }
334
+
335
+ @media (prefers-color-scheme: light) {
336
+ :global(:root:not([data-theme])),
337
+ :global(:host:not([data-theme])) {
338
+ color-scheme: light;
339
+ --sui-foreground-color-1-hsl: var(--sui-base-hue) 5% 5%;
340
+ --sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 25%;
341
+ --sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 35%;
342
+ --sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 45%;
343
+ --sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 65%;
344
+ --sui-background-color-1-hsl: var(--sui-base-hue) 5% 100%;
345
+ --sui-background-color-2-hsl: var(--sui-base-hue) 5% 98%;
346
+ --sui-background-color-3-hsl: var(--sui-base-hue) 5% 96%;
347
+ --sui-background-color-4-hsl: var(--sui-base-hue) 5% 94%;
348
+ --sui-background-color-5-hsl: var(--sui-base-hue) 5% 84%;
349
+ --sui-border-color-1-hsl: var(--sui-base-hue) 5% 65%;
350
+ --sui-border-color-2-hsl: var(--sui-base-hue) 5% 84%;
351
+ --sui-border-color-3-hsl: var(--sui-base-hue) 5% 88%;
352
+ --sui-shadow-color: var(--sui-base-hue) 10% 0%;
353
+ --sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 40%);
354
+ --sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 45%);
355
+ --sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 40%);
356
+ --sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 35%);
357
+ --sui-primary-accent-color-inverted: hsl(var(--sui-base-hue) 10% 100%);
358
+ --sui-primary-accent-color-translucent: hsl(var(--sui-base-hue) 80% 50% / 40%);
359
+ --sui-error-color-hue: 0;
360
+ --sui-warning-color-hue: 40;
361
+ --sui-info-color-hue: 210;
362
+ --sui-success-color-hue: 100;
363
+ --sui-alert-foreground-color-saturation: 85%;
364
+ --sui-alert-foreground-color-lightness: 25%;
365
+ --sui-alert-background-color-saturation: 65%;
366
+ --sui-alert-background-color-lightness: 90%;
367
+ --sui-alert-border-color-saturation: 48%;
368
+ --sui-alert-border-color-lightness: 68%;
369
+ }
370
+ }
371
+ @media (prefers-color-scheme: dark) {
372
+ :global(:root:not([data-theme])),
373
+ :global(:host:not([data-theme])) {
374
+ color-scheme: dark;
375
+ --sui-foreground-color-1-hsl: var(--sui-base-hue) 10% 95%;
376
+ --sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 75%;
377
+ --sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 65%;
378
+ --sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 55%;
379
+ --sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 35%;
380
+ --sui-background-color-1-hsl: var(--sui-base-hue) 10% 10%;
381
+ --sui-background-color-2-hsl: var(--sui-base-hue) 10% 12%;
382
+ --sui-background-color-3-hsl: var(--sui-base-hue) 10% 14%;
383
+ --sui-background-color-4-hsl: var(--sui-base-hue) 10% 16%;
384
+ --sui-background-color-5-hsl: var(--sui-base-hue) 10% 26%;
385
+ --sui-border-color-1-hsl: var(--sui-base-hue) 10% 45%;
386
+ --sui-border-color-2-hsl: var(--sui-base-hue) 10% 26%;
387
+ --sui-border-color-3-hsl: var(--sui-base-hue) 10% 22%;
388
+ --sui-shadow-color: var(--sui-base-hue) 10% 0%;
389
+ --sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 60%);
390
+ --sui-primary-accent-color-light: hsl(var(--sui-base-hue) 100% 45%);
391
+ --sui-primary-accent-color: hsl(var(--sui-base-hue) 100% 40%);
392
+ --sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 100% 35%);
393
+ --sui-primary-accent-color-inverted: hsl(var(--sui-base-hue) 10% 100%);
394
+ --sui-primary-accent-color-translucent: hsl(var(--sui-base-hue) 80% 50% / 40%);
395
+ --sui-error-color-hue: 0;
396
+ --sui-warning-color-hue: 40;
397
+ --sui-info-color-hue: 210;
398
+ --sui-success-color-hue: 100;
399
+ --sui-alert-foreground-color-saturation: 85%;
400
+ --sui-alert-foreground-color-lightness: 75%;
401
+ --sui-alert-background-color-saturation: 40%;
402
+ --sui-alert-background-color-lightness: 10%;
403
+ --sui-alert-border-color-saturation: 38%;
404
+ --sui-alert-border-color-lightness: 18%;
405
+ }
406
+ }
407
+ :global(.material-symbols-outlined) {
408
+ font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;
409
+ }
410
+
411
+ :global(*),
412
+ :global(::before),
413
+ :global(::after) {
414
+ overflow-anchor: none;
415
+ scroll-behavior: smooth;
416
+ box-sizing: border-box;
417
+ outline-offset: 0px;
418
+ outline-width: var(--sui-focus-ring-width) !important;
419
+ outline-style: solid;
420
+ outline-color: transparent;
421
+ border-width: 0;
422
+ border-style: solid;
423
+ vertical-align: top;
424
+ }
425
+ @media (prefers-reduced-motion) {
426
+ :global(*),
427
+ :global(::before),
428
+ :global(::after) {
429
+ scroll-behavior: auto;
430
+ transition-duration: 1ms !important;
431
+ }
432
+ }
433
+
434
+ :global(::selection) {
435
+ background-color: var(--sui-primary-accent-color-translucent);
436
+ }
437
+
438
+ :global(*) {
439
+ -webkit-tap-highlight-color: transparent;
440
+ }
441
+
442
+ :global(:focus) {
443
+ z-index: 1;
444
+ outline-width: 0;
445
+ }
446
+
447
+ :global(:focus-visible) {
448
+ outline-color: var(--sui-primary-accent-color-translucent);
449
+ z-index: 2;
450
+ }
451
+
452
+ :global(h1),
453
+ :global(h2),
454
+ :global(h3),
455
+ :global(h4),
456
+ :global(h5),
457
+ :global(h6) {
458
+ margin: 0;
459
+ font-weight: var(--sui-font-weight-bold);
460
+ line-height: var(--sui-line-height-default);
461
+ }
462
+
463
+ :global(h1) {
464
+ font-size: 32px;
465
+ }
466
+
467
+ :global(h2) {
468
+ font-size: 28px;
469
+ }
470
+
471
+ :global(h3) {
472
+ font-size: 24px;
473
+ }
474
+
475
+ :global(h4) {
476
+ font-size: 20px;
477
+ }
478
+
479
+ :global(h5) {
480
+ font-size: 16px;
481
+ }
482
+
483
+ :global(h6) {
484
+ font-size: 12px;
485
+ }
486
+
487
+ :global(strong) {
488
+ font-weight: var(--sui-font-weight-bold);
489
+ }
490
+
491
+ :global(a) {
492
+ color: var(--sui-primary-accent-color-text);
493
+ text-decoration: none;
494
+ text-underline-offset: 2px;
495
+ }
496
+ :global(a:hover), :global(a:focus), :global(a:active) {
497
+ text-decoration: underline;
498
+ }
499
+ :global(:root[data-underline-links=true]) :global(a), :global(:host[data-underline-links=true]) :global(a) {
500
+ text-decoration: underline;
501
+ }
502
+
503
+ :global(p),
504
+ :global(li) {
505
+ line-height: var(--sui-line-height-comfortable);
506
+ }
507
+
508
+ :global(ul),
509
+ :global(ol) {
510
+ padding-left: 2em;
511
+ }
512
+
513
+ :global(code),
514
+ :global(pre) {
515
+ border-radius: 4px;
516
+ background-color: var(--sui-code-background-color);
517
+ font-family: var(--sui-font-family-monospace);
518
+ font-size: var(--sui-font-size-monospace);
519
+ vertical-align: -0.05em;
520
+ }
521
+
522
+ :global(pre) {
523
+ padding: 8px;
524
+ line-height: var(--sui-line-height-compact);
525
+ -webkit-user-select: text;
526
+ user-select: text;
527
+ }
528
+
529
+ :global(code) {
530
+ padding: 2px 4px;
531
+ }
532
+
533
+ :global(table) {
534
+ border-collapse: collapse;
535
+ }
536
+
537
+ :global(th),
538
+ :global(td) {
539
+ border: 1px solid var(--sui-textbox-border-color);
540
+ padding: 8px;
541
+ }
542
+
543
+ :global(blockquote) {
544
+ margin-left: 16px;
545
+ border-left: 4px solid var(--sui-textbox-border-color);
546
+ padding-left: 12px;
547
+ }
548
+
549
+ :global(.disabled),
550
+ :global(.readonly),
551
+ :global([aria-disabled=true]),
552
+ :global([aria-readonly=true]),
553
+ :global([inert]) {
554
+ cursor: default;
555
+ pointer-events: none;
556
+ -webkit-user-select: none;
557
+ user-select: none;
558
+ filter: grayscale(1) opacity(0.35);
559
+ }
560
+ :global(.disabled) :global(*),
561
+ :global(.readonly) :global(*),
562
+ :global([aria-disabled=true]) :global(*),
563
+ :global([aria-readonly=true]) :global(*),
564
+ :global([inert]) :global(*) {
565
+ filter: grayscale(0) opacity(1);
566
+ }
567
+
568
+ :global(.disabled) :global(*),
569
+ :global(.readonly) :global(*),
570
+ :global([aria-disabled=true]) :global(*),
571
+ :global([aria-readonly=true]) :global(*),
572
+ :global([inert]) :global(*) {
573
+ cursor: default;
574
+ pointer-events: none;
575
+ -webkit-user-select: none;
576
+ user-select: none;
577
+ }
578
+
579
+ :global(.font-loader) {
91
580
  position: absolute;
92
581
  left: -99999px;
93
582
  font-family: var(--sui-font-family-default);
@@ -39,7 +39,7 @@
39
39
  export let content = undefined;
40
40
  /**
41
41
  * Where to show the popup.
42
- * @type {PopupPosition}
42
+ * @type {import('../../typedefs').PopupPosition}
43
43
  */
44
44
  export let position = 'bottom-left';
45
45
  /**
@@ -6,7 +6,7 @@ export default class Popup extends SvelteComponent<{
6
6
  [x: string]: any;
7
7
  anchor: HTMLElement | undefined;
8
8
  class?: string | undefined;
9
- position?: PopupPosition | undefined;
9
+ position?: import("../../typedefs").PopupPosition | undefined;
10
10
  open?: import("svelte/store").Writable<boolean> | undefined;
11
11
  showBackdrop?: boolean | undefined;
12
12
  content?: HTMLElement | undefined;
@@ -43,8 +43,8 @@ export default class Popup extends SvelteComponent<{
43
43
  set content(_: HTMLElement | undefined);
44
44
  get content(): HTMLElement | undefined;
45
45
  /**accessor*/
46
- set position(_: PopupPosition | undefined);
47
- get position(): PopupPosition | undefined;
46
+ set position(_: import("../../typedefs").PopupPosition | undefined);
47
+ get position(): import("../../typedefs").PopupPosition | undefined;
48
48
  /**accessor*/
49
49
  set positionBaseElement(_: HTMLElement | undefined);
50
50
  get positionBaseElement(): HTMLElement | undefined;
@@ -61,7 +61,7 @@ declare const __propDef: {
61
61
  [x: string]: any;
62
62
  anchor: HTMLElement | undefined;
63
63
  class?: string | undefined;
64
- position?: PopupPosition | undefined;
64
+ position?: import("../../typedefs").PopupPosition | undefined;
65
65
  open?: import("svelte/store").Writable<boolean> | undefined;
66
66
  showBackdrop?: boolean | undefined;
67
67
  content?: HTMLElement | undefined;
@@ -68,3 +68,4 @@ export { default as Toolbar } from "./components/toolbar/toolbar.svelte";
68
68
  export { default as AppShell } from "./components/util/app-shell.svelte";
69
69
  export { default as Group } from "./components/util/group.svelte";
70
70
  export { default as Modal } from "./components/util/modal.svelte";
71
+ export * from "./typedefs";
package/package/index.js CHANGED
@@ -93,3 +93,6 @@ export { default as Toolbar } from './components/toolbar/toolbar.svelte';
93
93
  export { default as AppShell } from './components/util/app-shell.svelte';
94
94
  export { default as Group } from './components/util/group.svelte';
95
95
  export { default as Modal } from './components/util/modal.svelte';
96
+
97
+ // eslint-disable-next-line import/export
98
+ export * from './typedefs';
@@ -66,16 +66,29 @@ export const activateKeyShortcuts = (element, shortcuts = '') => {
66
66
  const { disabled, offsetParent } = element;
67
67
  const { top, left } = element.getBoundingClientRect();
68
68
 
69
- // Check if the element is enabled, visible and clickable (not behind a modal dialog)
70
- if (
71
- !disabled &&
72
- !!offsetParent &&
73
- document.elementsFromPoint(left + 4, top + 4).includes(element) &&
74
- matchShortcuts(event, /** @type {string} */ (platformKeyShortcuts))
75
- ) {
69
+ // Check if the element is visible
70
+ if (!matchShortcuts(event, /** @type {string} */ (platformKeyShortcuts)) || !offsetParent) {
71
+ return;
72
+ }
73
+
74
+ if (disabled) {
75
+ // Make sure `elementsFromPoint()` works as expected
76
+ element.style.setProperty('pointer-events', 'auto');
77
+ }
78
+
79
+ // Check if the element is clickable (not behind a modal dialog)
80
+ if (document.elementsFromPoint(left + 4, top + 4).includes(element)) {
76
81
  event.preventDefault();
77
- element.focus();
78
- element.click();
82
+
83
+ // Trigger click only when the element is enabled
84
+ if (!disabled) {
85
+ element.focus();
86
+ element.click();
87
+ }
88
+ }
89
+
90
+ if (disabled) {
91
+ element.style.removeProperty('pointer-events');
79
92
  }
80
93
  };
81
94
 
@@ -7,11 +7,11 @@ declare class Popup {
7
7
  * Initialize a new `Popup` instance.
8
8
  * @param {HTMLButtonElement} anchorElement - `<button>` element that triggers the popup.
9
9
  * @param {HTMLDialogElement} popupElement - `<dialog>` element to be used for the popup.
10
- * @param {PopupPosition} position - Where to show the popup content.
10
+ * @param {import('../typedefs').PopupPosition} position - Where to show the popup content.
11
11
  * @param {HTMLElement} [positionBaseElement] - The base element of the `position`. If omitted,
12
12
  * this will be the `anchorElement`.
13
13
  */
14
- constructor(anchorElement: HTMLButtonElement, popupElement: HTMLDialogElement, position: PopupPosition, positionBaseElement?: HTMLElement | undefined);
14
+ constructor(anchorElement: HTMLButtonElement, popupElement: HTMLDialogElement, position: import("../typedefs").PopupPosition, positionBaseElement?: HTMLElement | undefined);
15
15
  open: import("svelte/store").Writable<boolean>;
16
16
  /**
17
17
  * @type {import('svelte/store').Writable<{
@@ -32,7 +32,7 @@ declare class Popup {
32
32
  observer: IntersectionObserver;
33
33
  anchorElement: HTMLButtonElement;
34
34
  popupElement: HTMLDialogElement;
35
- position: PopupPosition;
35
+ position: import("../typedefs").PopupPosition;
36
36
  positionBaseElement: HTMLElement;
37
37
  id: string;
38
38
  /**
@@ -45,7 +45,9 @@ class Popup {
45
45
  if (position.startsWith('bottom-')) {
46
46
  if (contentHeight > bottomMargin) {
47
47
  if (topMargin > bottomMargin) {
48
- position = /** @type {PopupPosition} */ (position.replace('bottom-', 'top-'));
48
+ position = /** @type {import('../typedefs').PopupPosition} */ (
49
+ position.replace('bottom-', 'top-')
50
+ );
49
51
  height = topMargin;
50
52
  } else {
51
53
  height = bottomMargin;
@@ -56,7 +58,9 @@ class Popup {
56
58
  // If the popup overflows the viewport, change the position
57
59
  if (position.endsWith('-left')) {
58
60
  if (intersectionRect.left + contentWidth > rootBounds.width - 8) {
59
- position = /** @type {PopupPosition} */ (position.replace('-left', '-right'));
61
+ position = /** @type {import('../typedefs').PopupPosition} */ (
62
+ position.replace('-left', '-right')
63
+ );
60
64
  }
61
65
  }
62
66
 
@@ -106,7 +110,7 @@ class Popup {
106
110
  * Initialize a new `Popup` instance.
107
111
  * @param {HTMLButtonElement} anchorElement - `<button>` element that triggers the popup.
108
112
  * @param {HTMLDialogElement} popupElement - `<dialog>` element to be used for the popup.
109
- * @param {PopupPosition} position - Where to show the popup content.
113
+ * @param {import('../typedefs').PopupPosition} position - Where to show the popup content.
110
114
  * @param {HTMLElement} [positionBaseElement] - The base element of the `position`. If omitted,
111
115
  * this will be the `anchorElement`.
112
116
  */
@@ -1,10 +1,10 @@
1
- type PopupPosition = ("top-left" | "top-right" | "right-top" | "right-bottom" | "bottom-left" | "bottom-right" | "left-top" | "left-bottom");
2
- type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
3
- type TextEditorBlockType = "paragraph" | "heading-1" | "heading-2" | "heading-3" | "heading-4" | "heading-5" | "heading-6" | "bulleted-list" | "numbered-list" | "blockquote";
4
- type TextEditorFormatType = "bold" | "italic" | "code";
5
- type TextEditorInlineType = TextEditorFormatType | "link";
6
- type TextEditorMode = "rich-text" | "plain-text";
7
- type TextEditorState = {
1
+ export type PopupPosition = ("top-left" | "top-right" | "right-top" | "right-bottom" | "bottom-left" | "bottom-right" | "left-top" | "left-bottom");
2
+ export type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
3
+ export type TextEditorBlockType = "paragraph" | "heading-1" | "heading-2" | "heading-3" | "heading-4" | "heading-5" | "heading-6" | "bulleted-list" | "numbered-list" | "blockquote";
4
+ export type TextEditorFormatType = "bold" | "italic" | "code";
5
+ export type TextEditorInlineType = TextEditorFormatType | "link";
6
+ export type TextEditorMode = "rich-text" | "plain-text";
7
+ export type TextEditorState = {
8
8
  /**
9
9
  * - Lexical
10
10
  * editor instance.
@@ -43,3 +43,5 @@
43
43
  * the editor.
44
44
  * @property {Function} convertMarkdown - Function to trigger the Lexical converter.
45
45
  */
46
+
47
+ export {};