@nemigo/layout 2.1.2 → 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.
@@ -1,7 +1,7 @@
1
- <script module lang="ts">import { setContext } from "svelte";
2
- </script>
1
+ <script module lang="ts"></script>
3
2
 
4
- <script lang="ts">let { key, value, children } = $props();
3
+ <script lang="ts">import { setContext } from "svelte";
4
+ const { key, value, children } = $props();
5
5
  setContext(key, value);
6
6
  </script>
7
7
 
@@ -1,9 +1,21 @@
1
- <script module lang="ts">export {};
2
- </script>
1
+ <script module lang="ts"></script>
3
2
 
4
3
  <script lang="ts">import { preventStop, usePreventStop } from "@nemigo/helpers/html/events";
5
- let { id, label, class: className, style, disabled, load, onclick: onClick, onmousedown, onenterdown, onkeydown, oncontextmenu, children } = $props();
6
- let ariaLabel = $derived(label ?? undefined);
4
+ const {
5
+ id,
6
+ label,
7
+ class: className,
8
+ style,
9
+ disabled,
10
+ load,
11
+ onclick: onClick,
12
+ onmousedown,
13
+ onenterdown,
14
+ onkeydown,
15
+ oncontextmenu,
16
+ children
17
+ } = $props();
18
+ const ariaLabel = $derived(label ?? void 0);
7
19
  </script>
8
20
 
9
21
  {#if onClick}
@@ -26,17 +38,15 @@ let ariaLabel = $derived(label ?? undefined);
26
38
  if (e.altKey) {
27
39
  if (oncontextmenu) {
28
40
  preventStop(e);
29
- // @ts-expect-error <сужение на уровне типов у компонента>
41
+ // @ts-expect-error : сужение на уровне типов у компонента
30
42
  oncontextmenu(e);
31
43
  }
32
- } else {
33
- // @ts-expect-error <сужение на уровне типов у компонента>
34
- onenterdown ? onenterdown(e) : onClick(e);
35
- }
44
+ } else if (onenterdown) onenterdown(e);
45
+ else onClick(e);
36
46
  } else if (e.key === "ContextMenu") {
37
47
  if (oncontextmenu) {
38
48
  preventStop(e);
39
- // @ts-expect-error <сужение на уровне типов у компонента>
49
+ // @ts-expect-error : сужение на уровне типов у компонента
40
50
  oncontextmenu(e);
41
51
  }
42
52
  } else {
@@ -1,10 +1,9 @@
1
- <script module lang="ts">export {};
2
- </script>
1
+ <script module lang="ts"></script>
3
2
 
4
- <script lang="ts">import { delay as Delay } from "@nemigo/helpers/async";
3
+ <script lang="ts">import { delay as useDelay } from "@nemigo/helpers/async";
5
4
  import { isSSR } from "@nemigo/helpers/html";
6
- let { delay, trigger, load } = $props();
7
- const _trigger = isSSR ? trigger ?? Delay(delay ?? 500) : null;
5
+ const { delay, trigger, load } = $props();
6
+ const _trigger = isSSR ? trigger ?? useDelay(delay ?? 500) : null;
8
7
  </script>
9
8
 
10
9
  {#if !isSSR}
@@ -2,25 +2,25 @@
2
2
  import { Navigation } from "@nemigo/svelte/kit/navigation";
3
3
  import { linear } from "svelte/easing";
4
4
  import { blur } from "svelte/transition";
5
- let { class: className, duration = 290, handler, children } = $props();
5
+ const { class: className, duration = 290, handler, children } = $props();
6
6
  const __navigation = Navigation.default(handler).hydrate();
7
7
  let animate = $state(false);
8
- let show = $derived(!__navigation.state.signal && !animate);
8
+ const show = $derived(!__navigation.state.signal && !animate);
9
9
  const stepper = {
10
- in: {
11
- get duration() {
12
- return duration;
13
- },
14
- amount: 7,
15
- easing: linear
16
- },
17
- out: {
18
- get duration() {
19
- return duration;
20
- },
21
- amount: 14,
22
- easing: linear
23
- }
10
+ in: {
11
+ get duration() {
12
+ return duration;
13
+ },
14
+ amount: 7,
15
+ easing: linear
16
+ },
17
+ out: {
18
+ get duration() {
19
+ return duration;
20
+ },
21
+ amount: 14,
22
+ easing: linear
23
+ }
24
24
  };
25
25
  </script>
26
26
 
@@ -3,7 +3,7 @@ export const loaderCursorStore = LoaderStore.default();
3
3
  </script>
4
4
 
5
5
  <script lang="ts">$effect(() => {
6
- document.documentElement.style.cursor = loaderCursorStore.state.signal ? "wait" : "auto";
6
+ document.documentElement.style.cursor = loaderCursorStore.state.signal ? "wait" : "auto";
7
7
  });
8
8
  loaderCursorStore.hydrate();
9
9
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nemigo/layout",
3
- "version": "2.1.2",
3
+ "version": "2.2.0",
4
4
  "private": false,
5
5
  "author": {
6
6
  "name": "Vlad Logvin",
@@ -8,14 +8,12 @@
8
8
  },
9
9
  "type": "module",
10
10
  "scripts": {
11
- "build": "svelte-package && rimraf .svelte-kit",
12
- "check": "svelte-check --tsconfig ./tsconfig.json",
11
+ "build": "bunx --bun svelte-package && bunx --bun rimraf .svelte-kit",
12
+ "check": "bunx --bun svelte-check --tsconfig ./tsconfig.json",
13
13
  "eslint": "bunx --bun eslint ./",
14
- "eslint:fix": "bunx --bun eslint --fix ./",
15
- "lint": "biome lint",
16
- "lint:fix": "biome lint --fix --unsafe",
17
- "lint:fix:unsafe": "biome lint --fix --unsafe",
18
- "format": "bunx --bun prettier --write ./ && biome check --write --linter-enabled=false"
14
+ "oxlint": "bunx --bun oxlint --config .././../oxlintrc.jsonc --ignore-path ../configs/.eslint.ignore ./",
15
+ "bilint": "bunx --bun biome lint",
16
+ "format": "bunx --bun prettier --write ./ && bunx --bun biome check --write --linter-enabled=false"
19
17
  },
20
18
  "exports": {
21
19
  "./Context": {
@@ -40,10 +38,10 @@
40
38
  }
41
39
  },
42
40
  "peerDependencies": {
43
- "@nemigo/helpers": ">=2.0.0",
44
- "@nemigo/svelte": ">=2.1.0",
45
- "@sveltejs/kit": ">=2.12.0",
46
- "svelte": ">=5.0.0"
41
+ "@nemigo/helpers": ">=2.2.0",
42
+ "@nemigo/svelte": ">=2.2.0",
43
+ "@sveltejs/kit": ">=2.49.0",
44
+ "svelte": ">=5.44.0"
47
45
  },
48
46
  "peerDependenciesMeta": {
49
47
  "@sveltejs/kit": {
@@ -51,8 +49,8 @@
51
49
  }
52
50
  },
53
51
  "devDependencies": {
54
- "@nemigo/configs": "2.1.0",
55
- "@nemigo/helpers": "2.0.0",
56
- "@nemigo/svelte": "2.1.0"
52
+ "@nemigo/configs": "2.2.0",
53
+ "@nemigo/helpers": "2.2.0",
54
+ "@nemigo/svelte": "2.2.0"
57
55
  }
58
56
  }