kenspeckle 0.1.1 → 0.1.3
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 +37 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -55,11 +55,31 @@ npm install kenspeckle
|
|
|
55
55
|
|
|
56
56
|
Peer dependencies: `svelte >= 5.40`, plus `@sveltejs/kit >= 2` for the `kenspeckle/kit` subpath (optional). SSR-safe — value factories return inert defaults on the server.
|
|
57
57
|
|
|
58
|
-
## What's
|
|
58
|
+
## What's shipped
|
|
59
|
+
|
|
60
|
+
Five exports, two entry points. `kenspeckle` is Svelte-only; `kenspeckle/kit` adds the SvelteKit
|
|
61
|
+
pieces, so `$app/navigation` never enters the main entry.
|
|
62
|
+
|
|
63
|
+
| export | form | lineage |
|
|
64
|
+
| ----------------------- | -------------------------------------- | -------------------------- |
|
|
65
|
+
| `FiniteStateMachine` | class, with typed reactive `context` | runed `FiniteStateMachine` |
|
|
66
|
+
| `copy()` / `copyText()` | attachment + helper | svelte-put `copy` |
|
|
67
|
+
| `viewTransition()` | function; navigation form under `/kit` | new |
|
|
68
|
+
| `viewTransitionName()` | attachment + helper, `/kit` | new |
|
|
69
|
+
| `retreat()` | function, returns a disposer, `/kit` | new |
|
|
70
|
+
|
|
71
|
+
`FiniteStateMachine` gains a typed, `$state`-backed `context` object visible to lifecycle hooks and
|
|
72
|
+
guards — the sidecar-data mechanism every real FSM grows, built in.
|
|
73
|
+
|
|
74
|
+
View transitions are what the package is for so far; they get their own section below.
|
|
75
|
+
|
|
76
|
+
## Planned
|
|
77
|
+
|
|
78
|
+
The rest of the curation. These names are the design, not an API you can call — nothing below has
|
|
79
|
+
shipped.
|
|
59
80
|
|
|
60
81
|
| export | form | lineage |
|
|
61
82
|
| ------------------------------------------------------------ | ------------------------------------------ | -------------------------------------------------------- |
|
|
62
|
-
| `FiniteStateMachine` | class, with typed reactive `context` | runed `FiniteStateMachine` |
|
|
63
83
|
| `StateHistory` | class | runed `StateHistory` |
|
|
64
84
|
| `mounted()` | value factory | runed `IsMounted` |
|
|
65
85
|
| `idle()` | value factory | runed `IsIdle` |
|
|
@@ -74,13 +94,9 @@ Peer dependencies: `svelte >= 5.40`, plus `@sveltejs/kit >= 2` for the `kenspeck
|
|
|
74
94
|
| `intersected()` | attachment + helper | runed `useIntersectionObserver` · svelte-put `intersect` |
|
|
75
95
|
| `resized()` | attachment + helper | runed `useResizeObserver` · svelte-put `resize` |
|
|
76
96
|
| `mutated()` | attachment + helper | runed `useMutationObserver` |
|
|
77
|
-
| `copy()` | attachment + helper | svelte-put `copy` |
|
|
78
97
|
| `shortcut()` | attachment + helper | svelte-put `shortcut` |
|
|
79
98
|
| `lockScroll` | attachment ≡ helper, stacked lock counting | new |
|
|
80
99
|
| `dragScroll()` | attachment | svelte-put `dragscroll` |
|
|
81
|
-
| `viewTransition()` | function; navigation form under `/kit` | new |
|
|
82
|
-
| `viewTransitionName()` | attachment + helper | new |
|
|
83
|
-
| `retreat()` | function, returns a disposer | new |
|
|
84
100
|
| `debounced()` / `throttled()` | value factory | runed `Debounced` / `Throttled` |
|
|
85
101
|
| `debounce()` / `throttle()` | function wrapper | runed `useDebounce` / `useThrottle` |
|
|
86
102
|
| `previous()` | value factory | runed `Previous` |
|
|
@@ -94,11 +110,9 @@ Peer dependencies: `svelte >= 5.40`, plus `@sveltejs/kit >= 2` for the `kenspeck
|
|
|
94
110
|
| `searchParams()` + helpers | value factory | runed `useSearchParams` |
|
|
95
111
|
| `watch` / `watchOnce` / `extract` / `onCleanup` / `boolAttr` | unchanged | runed |
|
|
96
112
|
|
|
97
|
-
Dropped, deliberately: runed's `Context` — Svelte ≥ 5.40's `createContext` returns a typed
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
View transitions ship in two tiers. `viewTransition(update)` animates a state change within a route; the SvelteKit navigation form, plus `viewTransitionName` and `retreat`, come from the `kenspeckle/kit` subpath — separate so `$app/navigation` never enters the main entry. Both tiers fall back cleanly: with no `document.startViewTransition`, or under `prefers-reduced-motion`, the update still runs, untransitioned.
|
|
113
|
+
Dropped, deliberately: runed's `Context` — Svelte ≥ 5.40's `createContext` returns a typed
|
|
114
|
+
`[get, set]` pair and covers it. runed's `resource` waits in the backlog — SvelteKit remote functions
|
|
115
|
+
cover the server-data case; it returns only if a real client-only async need shows up.
|
|
102
116
|
|
|
103
117
|
## View transitions
|
|
104
118
|
|
|
@@ -192,6 +206,18 @@ const dispose = viewTransitionName(element, 'back-button');
|
|
|
192
206
|
`viewTransition(update)` on a same-route step names nothing. Morph a stepping element with static
|
|
193
207
|
`view-transition-name` in CSS instead.
|
|
194
208
|
|
|
209
|
+
## Claude Code plugin
|
|
210
|
+
|
|
211
|
+
This repo doubles as a Claude Code plugin. `skills/view-transitions/` is the
|
|
212
|
+
agent-facing guide to the view-transition tier — the `data-view-transition`
|
|
213
|
+
contract, `viewTransitionName` claims and their phases, the duplicate-name
|
|
214
|
+
abort, and the list of things the library already handles so an agent stops
|
|
215
|
+
reimplementing them. Point a marketplace entry at this repo
|
|
216
|
+
(`.claude-plugin/plugin.json` is at the root) and it installs as `kenspeckle`,
|
|
217
|
+
invoked as `/kenspeckle:view-transitions`.
|
|
218
|
+
|
|
219
|
+
The skill and the code ship in the same change, same rule as the docs pages.
|
|
220
|
+
|
|
195
221
|
## Provenance
|
|
196
222
|
|
|
197
223
|
kenspeckle is a curation, not a fork. [runed](https://runed.dev) has genuinely useful utilities under three naming regimes at once — PascalCase classes, bare functions, and React-style `use` hooks, with pairs like `Debounced` / `useDebounce` coexisting. [svelte-put](https://svelte-put.vnphanquang.com) has good actions from the Svelte 4 era, before attachments existed. kenspeckle reshapes both pools under one convention and adds what neither ships: attachments as a first-class layer.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kenspeckle",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
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>",
|