kenspeckle 0.2.0 → 0.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/README.md +15 -15
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Svelte utilities you recognize at sight: each one is shaped the way Svelte shape
|
|
|
7
7
|
|
|
8
8
|
## Shaped like Svelte
|
|
9
9
|
|
|
10
|
-
A utility makes the cut only if Svelte doesn't already handle it. Handled means a Svelte or Kit API covers it (a binding, `on()`, `onDestroy`, `<svelte:document>`, an `$effect` with a returned cleanup), the platform does (`field-sizing`, `:focus-within`), or a few lines of Svelte do, in which case it becomes a [recipe](
|
|
10
|
+
A utility makes the cut only if Svelte doesn't already handle it. Handled means a Svelte or Kit API covers it (a binding, `on()`, `onDestroy`, `<svelte:document>`, an `$effect` with a returned cleanup), the platform does (`field-sizing`, `:focus-within`), or a few lines of Svelte do, in which case it becomes a [recipe](https://kenspeckle.brandonpittman.workers.dev/docs/recipes) instead of an export.
|
|
11
11
|
|
|
12
12
|
What makes the cut takes the shape Svelte already uses for the same kind of thing. Ask these in order; the first yes decides:
|
|
13
13
|
|
|
@@ -55,21 +55,21 @@ Peer dependencies: `svelte >= 5.40`, plus `@sveltejs/kit >= 2` for the `kenspeck
|
|
|
55
55
|
|
|
56
56
|
## What's shipped
|
|
57
57
|
|
|
58
|
-
Ten exports, two entry points, each documented under [
|
|
58
|
+
Ten exports, two entry points, each documented under [the docs site](https://kenspeckle.brandonpittman.workers.dev/docs). `kenspeckle` is Svelte-only; `kenspeckle/kit` adds the SvelteKit
|
|
59
59
|
pieces, so `$app/navigation` never enters the main entry.
|
|
60
60
|
|
|
61
|
-
| export
|
|
62
|
-
|
|
|
63
|
-
| [`FiniteStateMachine`](
|
|
64
|
-
| [`PersistedState`](
|
|
65
|
-
| [`documentVisible`](
|
|
66
|
-
| [`copy()` / `copyText()`](
|
|
67
|
-
| [`scrollEdges()`](
|
|
68
|
-
| [`viewTransition()`](
|
|
69
|
-
| [`viewTransitionName()`](
|
|
70
|
-
| [`retreat()`](
|
|
71
|
-
| [`debounce()`](
|
|
72
|
-
| [`throttle()`](
|
|
61
|
+
| export | form |
|
|
62
|
+
| ------------------------------------------------------------------------------------------------- | -------------------------------------- |
|
|
63
|
+
| [`FiniteStateMachine`](https://kenspeckle.brandonpittman.workers.dev/docs/finite-state-machine) | class, with typed reactive `context` |
|
|
64
|
+
| [`PersistedState`](https://kenspeckle.brandonpittman.workers.dev/docs/persisted-state) | class, `.current` |
|
|
65
|
+
| [`documentVisible`](https://kenspeckle.brandonpittman.workers.dev/docs/document-visible) | singleton, `.current` |
|
|
66
|
+
| [`copy()` / `copyText()`](https://kenspeckle.brandonpittman.workers.dev/docs/copy) | attachment |
|
|
67
|
+
| [`scrollEdges()`](https://kenspeckle.brandonpittman.workers.dev/docs/scroll-edges) | attachment, edges to a callback |
|
|
68
|
+
| [`viewTransition()`](https://kenspeckle.brandonpittman.workers.dev/docs/view-transition) | function; navigation form under `/kit` |
|
|
69
|
+
| [`viewTransitionName()`](https://kenspeckle.brandonpittman.workers.dev/docs/view-transition-name) | attachment, `/kit` |
|
|
70
|
+
| [`retreat()`](https://kenspeckle.brandonpittman.workers.dev/docs/view-transition) | function, returns a disposer, `/kit` |
|
|
71
|
+
| [`debounce()`](https://kenspeckle.brandonpittman.workers.dev/docs/debounce) | function wrapper |
|
|
72
|
+
| [`throttle()`](https://kenspeckle.brandonpittman.workers.dev/docs/throttle) | function wrapper |
|
|
73
73
|
|
|
74
74
|
`FiniteStateMachine` has a typed, `$state`-backed `context` object visible to lifecycle hooks and
|
|
75
75
|
guards — the sidecar-data mechanism every real FSM grows, built in.
|
|
@@ -113,7 +113,7 @@ Dropped, deliberately, because Svelte, Kit or the platform already handles it:
|
|
|
113
113
|
- `extract`: nothing here takes a value-or-getter.
|
|
114
114
|
- `boolAttr`: Svelte omits nullish attributes, so `data-x={flag || undefined}`.
|
|
115
115
|
|
|
116
|
-
The [recipes](
|
|
116
|
+
The [recipes](https://kenspeckle.brandonpittman.workers.dev/docs/recipes) page spells out the replacements for `autosize`, `intersected`, `mutated`, `focusWithin` and `Previous`.
|
|
117
117
|
|
|
118
118
|
Waiting in the backlog: `resource`, since SvelteKit remote functions cover the server-data case, and `searchParams`, since Kit's `page.url.searchParams` and `goto` cover reads and writes until a typed layer earns its place.
|
|
119
119
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kenspeckle",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Svelte 5 utilities under one naming convention: attachments first-class, view transitions, and a state machine with context.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Brandon Pittman <brandon@brandonpittman.com>",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git+https://github.com/brandonpittman/kenspeckle.git"
|
|
10
10
|
},
|
|
11
|
-
"homepage": "https://
|
|
11
|
+
"homepage": "https://kenspeckle.brandonpittman.workers.dev/docs",
|
|
12
12
|
"bugs": "https://github.com/brandonpittman/kenspeckle/issues",
|
|
13
13
|
"scripts": {
|
|
14
14
|
"dev": "vite dev",
|