elements-kit 0.27.4 → 0.27.5
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 +1 -0
- package/dist/integrations/astro-client.mjs +1 -1
- package/dist/integrations/astro-server.mjs +1 -1
- package/dist/integrations/hmr-runtime.mjs +1 -1
- package/dist/jsx-runtime/dev.mjs +1 -1
- package/dist/server/index.mjs +1 -1
- package/dist/utilities/async.d.mts +6 -0
- package/dist/utilities/async.mjs +12 -0
- package/package.json +3 -4
- /package/dist/{hot-Zl0s17uq.mjs → hot-eP6QROpU.mjs} +0 -0
- /package/dist/{server-Qm9JTZ-J.mjs → server-CoEm-C0I.mjs} +0 -0
package/README.md
CHANGED
|
@@ -339,6 +339,7 @@ const op = async(() => fetch("/api/items").then((r) => r.json()));
|
|
|
339
339
|
op.start(); // run with reactive tracking — reruns when tracked signals change
|
|
340
340
|
await op; // awaitable (delegates to .then/.catch/.finally via .raw)
|
|
341
341
|
op.stop(); // halt reruns + fire registered cleanup
|
|
342
|
+
op.reset(); // stop + clear state back to `idle`
|
|
342
343
|
```
|
|
343
344
|
|
|
344
345
|
Reactive state getters: `.state` (`"idle" | "pending" | "fulfilled" | "rejected"` — `idle` before the first run, so `.pending` is `false` until you trigger one), `.value`, `.reason`, `.result`, `.pending`, `.raw` (the underlying `ComputedPromise`).
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as createElement } from "../element-DgQvp-49.mjs";
|
|
2
2
|
import { render } from "../render.mjs";
|
|
3
3
|
import { t as hydrate } from "../hydrate-ICXw1FIY.mjs";
|
|
4
|
-
import { withSlotProps } from "./astro-slots.mjs";
|
|
5
4
|
import { HMR_SLOT } from "./hmr-slot.mjs";
|
|
5
|
+
import { withSlotProps } from "./astro-slots.mjs";
|
|
6
6
|
//#region src/integrations/astro-client.ts
|
|
7
7
|
/**
|
|
8
8
|
* Astro client entrypoint: hydrate an elements-kit island.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { y as setInertEffects } from "../lib-DYypKhxk.mjs";
|
|
2
2
|
import { i as setRenderer, t as createElement } from "../element-DgQvp-49.mjs";
|
|
3
3
|
import { withSlotProps } from "./astro-slots.mjs";
|
|
4
|
-
import { i as serverJsx, n as renderToString, r as SNode } from "../server-
|
|
4
|
+
import { i as serverJsx, n as renderToString, r as SNode } from "../server-CoEm-C0I.mjs";
|
|
5
5
|
//#region src/integrations/astro-server.ts
|
|
6
6
|
/**
|
|
7
7
|
* Decide whether `Component` is an elements-kit component. Invoked by Astro
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as createElement } from "../element-DgQvp-49.mjs";
|
|
2
2
|
import { render } from "../render.mjs";
|
|
3
3
|
import { HMR_SLOT } from "./hmr-slot.mjs";
|
|
4
|
-
import { n as updateCells } from "../hot-
|
|
4
|
+
import { n as updateCells } from "../hot-eP6QROpU.mjs";
|
|
5
5
|
//#region src/integrations/hmr-runtime.ts
|
|
6
6
|
const slot = globalThis;
|
|
7
7
|
const records = /* @__PURE__ */ new Set();
|
package/dist/jsx-runtime/dev.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { t as Fragment } from "../fragment-BJfcQdsL.mjs";
|
|
2
|
-
import { t as createHotElement } from "../hot-Zl0s17uq.mjs";
|
|
3
2
|
import "./index.mjs";
|
|
3
|
+
import { t as createHotElement } from "../hot-eP6QROpU.mjs";
|
|
4
4
|
export { Fragment, createHotElement as h, createHotElement as jsx, createHotElement as jsxDEV, createHotElement as jsxs };
|
package/dist/server/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as renderToString, t as renderToStream } from "../server-
|
|
1
|
+
import { n as renderToString, t as renderToStream } from "../server-CoEm-C0I.mjs";
|
|
2
2
|
export { renderToStream, renderToString };
|
|
@@ -68,6 +68,12 @@ declare class Async<TInput = undefined, TOutput = unknown> {
|
|
|
68
68
|
* Stops the current async operation and run cleanup effects.
|
|
69
69
|
*/
|
|
70
70
|
stop(): this;
|
|
71
|
+
/**
|
|
72
|
+
* Stops the current operation and returns to the idle state — `state` is
|
|
73
|
+
* `"idle"` again and `value` / `reason` / `result` read `undefined`. Unlike
|
|
74
|
+
* {@link stop}, which leaves the last settled operation in place.
|
|
75
|
+
*/
|
|
76
|
+
reset(): this;
|
|
71
77
|
[Symbol.dispose](): void;
|
|
72
78
|
/**
|
|
73
79
|
* Starts a new reactive async operation, stopping any currently active one.
|
package/dist/utilities/async.mjs
CHANGED
|
@@ -138,6 +138,17 @@ var Async = class {
|
|
|
138
138
|
this.#cleanup = () => {};
|
|
139
139
|
return this;
|
|
140
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* Stops the current operation and returns to the idle state — `state` is
|
|
143
|
+
* `"idle"` again and `value` / `reason` / `result` read `undefined`. Unlike
|
|
144
|
+
* {@link stop}, which leaves the last settled operation in place.
|
|
145
|
+
*/
|
|
146
|
+
reset() {
|
|
147
|
+
this.stop();
|
|
148
|
+
deferredRuns.delete(this);
|
|
149
|
+
this.#current(IDLE);
|
|
150
|
+
return this;
|
|
151
|
+
}
|
|
141
152
|
[Symbol.dispose]() {
|
|
142
153
|
this.stop();
|
|
143
154
|
}
|
|
@@ -170,6 +181,7 @@ const ASYNC_KEYS = new Set([
|
|
|
170
181
|
"pending",
|
|
171
182
|
"start",
|
|
172
183
|
"stop",
|
|
184
|
+
"reset",
|
|
173
185
|
"run",
|
|
174
186
|
"fn",
|
|
175
187
|
"raw",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "elements-kit",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.27.
|
|
4
|
+
"version": "0.27.5",
|
|
5
5
|
"description": "A lightweight reactive UI library that transforms native HTMLElements into reactive components with signals. Ideal for framework-agnostic applications and web components.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"webcomponents",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
"test:watch": "vitest",
|
|
128
128
|
"test:engines": "node scripts/engine-matrix.mjs"
|
|
129
129
|
},
|
|
130
|
-
"packageManager": "pnpm@
|
|
130
|
+
"packageManager": "pnpm@11.25.0",
|
|
131
131
|
"devDependencies": {
|
|
132
132
|
"@tsdown/css": "^0.22.0",
|
|
133
133
|
"@types/react": "^19.2.14",
|
|
@@ -139,8 +139,7 @@
|
|
|
139
139
|
"react-dom": "^19.2.5",
|
|
140
140
|
"tsdown": "0.22.0",
|
|
141
141
|
"typescript": "^6.0.3",
|
|
142
|
-
"vitest": "^4.1.2"
|
|
143
|
-
"puppeteer-core": "^24.0.0"
|
|
142
|
+
"vitest": "^4.1.2"
|
|
144
143
|
},
|
|
145
144
|
"dependencies": {
|
|
146
145
|
"@floating-ui/dom": "^1.7.6",
|
|
File without changes
|
|
File without changes
|