@dorsk/tsumikit 0.35.0 → 0.35.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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
+
import { untrack } from 'svelte';
|
|
3
4
|
import { browser } from '../../env';
|
|
4
5
|
import Icon from '../atoms/Icon.svelte';
|
|
5
6
|
import Scrim from '../atoms/Scrim.svelte';
|
|
@@ -87,7 +88,6 @@
|
|
|
87
88
|
|
|
88
89
|
function measureLength(css: string) {
|
|
89
90
|
if (!browser || !root) return undefined;
|
|
90
|
-
console.count('measure ' + css);
|
|
91
91
|
const probe = document.createElement('div');
|
|
92
92
|
probe.style.cssText = `position:absolute;visibility:hidden;pointer-events:none;width:${css}`;
|
|
93
93
|
root.appendChild(probe);
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
$effect(() => {
|
|
129
129
|
if (!browser || restored) return;
|
|
130
130
|
restored = true;
|
|
131
|
-
lengthTick
|
|
131
|
+
lengthTick = untrack(() => lengthTick) + 1;
|
|
132
132
|
if (!widthKey) return;
|
|
133
133
|
|
|
134
134
|
const savedWidth = parseStoredWidth(
|
|
@@ -149,9 +149,8 @@
|
|
|
149
149
|
$effect(() => {
|
|
150
150
|
if (!browser) return;
|
|
151
151
|
const sync = () => {
|
|
152
|
-
console.count('sync');
|
|
153
152
|
viewportWidth = window.innerWidth;
|
|
154
|
-
lengthTick
|
|
153
|
+
lengthTick = untrack(() => lengthTick) + 1;
|
|
155
154
|
};
|
|
156
155
|
sync();
|
|
157
156
|
addEventListener('resize', sync);
|
|
@@ -163,7 +162,6 @@
|
|
|
163
162
|
fullBleed = false;
|
|
164
163
|
return;
|
|
165
164
|
}
|
|
166
|
-
console.count('bleed');
|
|
167
165
|
const query = matchMedia(`(max-width: ${fullWidthBelow})`);
|
|
168
166
|
const sync = () => {
|
|
169
167
|
fullBleed = query.matches;
|
|
@@ -175,7 +173,6 @@
|
|
|
175
173
|
|
|
176
174
|
$effect(() => {
|
|
177
175
|
if (!browser || !overlay || !open) return;
|
|
178
|
-
console.count('escape');
|
|
179
176
|
const onKeydown = (event: KeyboardEvent) => {
|
|
180
177
|
if (event.key !== 'Escape' || event.defaultPrevented) return;
|
|
181
178
|
event.preventDefault();
|
|
@@ -187,7 +184,6 @@
|
|
|
187
184
|
|
|
188
185
|
$effect(() => {
|
|
189
186
|
if (!browser || !overlay || !open || !panelEl) return;
|
|
190
|
-
console.count('focus');
|
|
191
187
|
const previous = document.activeElement as HTMLElement | null;
|
|
192
188
|
if (!panelEl.contains(previous)) panelEl.focus({ preventScroll: true });
|
|
193
189
|
return () => {
|
package/package.json
CHANGED