@getforma/core 1.4.0 → 1.5.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.
- package/dist/{chunk-AJP4OVCN.js → chunk-3U2IQIKB.js} +4 -4
- package/dist/{chunk-AJP4OVCN.js.map → chunk-3U2IQIKB.js.map} +1 -1
- package/dist/{chunk-FBM7V4NE.cjs → chunk-D46EJ3VS.cjs} +43 -43
- package/dist/{chunk-FBM7V4NE.cjs.map → chunk-D46EJ3VS.cjs.map} +1 -1
- package/dist/{chunk-Y3A2EVVS.js → chunk-F5QUU76U.js} +4 -4
- package/dist/{chunk-Y3A2EVVS.js.map → chunk-F5QUU76U.js.map} +1 -1
- package/dist/{chunk-ETPJTPYD.js → chunk-FAIWRZKJ.js} +6 -3
- package/dist/chunk-FAIWRZKJ.js.map +1 -0
- package/dist/{chunk-H7MDUHS5.cjs → chunk-HAULTMNX.cjs} +6 -2
- package/dist/chunk-HAULTMNX.cjs.map +1 -0
- package/dist/{chunk-KUXNZ5MG.cjs → chunk-PAKPQRVE.cjs} +14 -12
- package/dist/{chunk-KUXNZ5MG.cjs.map → chunk-PAKPQRVE.cjs.map} +1 -1
- package/dist/formajs.global.js +69 -11
- package/dist/formajs.global.js.map +1 -1
- package/dist/http.cjs +11 -11
- package/dist/http.js +2 -2
- package/dist/index.cjs +143 -76
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +39 -5
- package/dist/index.d.ts +39 -5
- package/dist/index.js +67 -16
- package/dist/index.js.map +1 -1
- package/dist/{resource-D6HfVgiA.d.cts → resource-CBTcorBJ.d.ts} +2 -2
- package/dist/{resource-ljs2X5NM.d.ts → resource-CaFfIB5i.d.cts} +2 -2
- package/dist/runtime.cjs +28 -28
- package/dist/runtime.js +3 -3
- package/dist/server.cjs +7 -7
- package/dist/server.d.cts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +2 -2
- package/dist/{signal-CRBJYQ6B.d.cts → signal-CIXTR4Qz.d.cts} +29 -1
- package/dist/{signal-CRBJYQ6B.d.ts → signal-CIXTR4Qz.d.ts} +29 -1
- package/dist/storage.cjs +66 -16
- package/dist/storage.cjs.map +1 -1
- package/dist/storage.js +66 -16
- package/dist/storage.js.map +1 -1
- package/dist/tc39-compat.cjs +3 -3
- package/dist/tc39-compat.d.cts +1 -1
- package/dist/tc39-compat.d.ts +1 -1
- package/dist/tc39-compat.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-ETPJTPYD.js.map +0 -1
- package/dist/chunk-H7MDUHS5.cjs.map +0 -1
package/dist/http.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkPAKPQRVE_cjs = require('./chunk-PAKPQRVE.cjs');
|
|
4
|
+
var chunkHAULTMNX_cjs = require('./chunk-HAULTMNX.cjs');
|
|
5
5
|
|
|
6
6
|
// src/http/fetch.ts
|
|
7
7
|
function createFetch(url, options) {
|
|
8
|
-
const [data, setData] =
|
|
9
|
-
const [error, setError] =
|
|
10
|
-
const [loading, setLoading] =
|
|
8
|
+
const [data, setData] = chunkHAULTMNX_cjs.createSignal(null);
|
|
9
|
+
const [error, setError] = chunkHAULTMNX_cjs.createSignal(null);
|
|
10
|
+
const [loading, setLoading] = chunkHAULTMNX_cjs.createSignal(false);
|
|
11
11
|
let currentController = null;
|
|
12
12
|
function resolveURL() {
|
|
13
13
|
const raw = typeof url === "function" ? url() : url;
|
|
@@ -57,7 +57,7 @@ function createFetch(url, options) {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
if (typeof url === "function") {
|
|
60
|
-
|
|
60
|
+
chunkPAKPQRVE_cjs.internalEffect(() => {
|
|
61
61
|
url();
|
|
62
62
|
void execute();
|
|
63
63
|
});
|
|
@@ -86,9 +86,9 @@ async function fetchJSON(url, options) {
|
|
|
86
86
|
|
|
87
87
|
// src/http/sse.ts
|
|
88
88
|
function createSSE(url, options) {
|
|
89
|
-
const [data, setData] =
|
|
90
|
-
const [error, setError] =
|
|
91
|
-
const [connected, setConnected] =
|
|
89
|
+
const [data, setData] = chunkHAULTMNX_cjs.createSignal(null);
|
|
90
|
+
const [error, setError] = chunkHAULTMNX_cjs.createSignal(null);
|
|
91
|
+
const [connected, setConnected] = chunkHAULTMNX_cjs.createSignal(false);
|
|
92
92
|
const source = new EventSource(url, {
|
|
93
93
|
withCredentials: options?.withCredentials ?? false
|
|
94
94
|
});
|
|
@@ -142,8 +142,8 @@ function createWebSocket(url, options) {
|
|
|
142
142
|
const shouldReconnect = options?.reconnect ?? true;
|
|
143
143
|
const baseInterval = options?.reconnectInterval ?? 1e3;
|
|
144
144
|
const maxReconnects = options?.maxReconnects ?? 5;
|
|
145
|
-
const [data, setData] =
|
|
146
|
-
const [status, setStatus] =
|
|
145
|
+
const [data, setData] = chunkHAULTMNX_cjs.createSignal(null);
|
|
146
|
+
const [status, setStatus] = chunkHAULTMNX_cjs.createSignal("connecting");
|
|
147
147
|
const handlers = /* @__PURE__ */ new Set();
|
|
148
148
|
let socket = null;
|
|
149
149
|
let reconnectCount = 0;
|
package/dist/http.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { internalEffect } from './chunk-
|
|
2
|
-
import { createSignal } from './chunk-
|
|
1
|
+
import { internalEffect } from './chunk-F5QUU76U.js';
|
|
2
|
+
import { createSignal } from './chunk-FAIWRZKJ.js';
|
|
3
3
|
|
|
4
4
|
// src/http/fetch.ts
|
|
5
5
|
function createFetch(url, options) {
|
package/dist/index.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkD46EJ3VS_cjs = require('./chunk-D46EJ3VS.cjs');
|
|
4
|
+
var chunkPAKPQRVE_cjs = require('./chunk-PAKPQRVE.cjs');
|
|
5
|
+
var chunkHAULTMNX_cjs = require('./chunk-HAULTMNX.cjs');
|
|
6
6
|
|
|
7
7
|
// src/dom/text.ts
|
|
8
8
|
function createText(value2) {
|
|
9
9
|
if (typeof value2 === "function") {
|
|
10
10
|
const node = new Text("");
|
|
11
|
-
|
|
11
|
+
chunkPAKPQRVE_cjs.internalEffect(() => {
|
|
12
12
|
node.data = value2();
|
|
13
13
|
});
|
|
14
14
|
return node;
|
|
@@ -24,12 +24,12 @@ function mount(component, container) {
|
|
|
24
24
|
}
|
|
25
25
|
let disposeRoot;
|
|
26
26
|
if (target.hasAttribute("data-forma-ssr")) {
|
|
27
|
-
|
|
27
|
+
chunkPAKPQRVE_cjs.createUnownedRoot((dispose) => {
|
|
28
28
|
disposeRoot = dispose;
|
|
29
|
-
|
|
29
|
+
chunkD46EJ3VS_cjs.hydrateIsland(component, target);
|
|
30
30
|
});
|
|
31
31
|
} else {
|
|
32
|
-
const dom =
|
|
32
|
+
const dom = chunkPAKPQRVE_cjs.createUnownedRoot((dispose) => {
|
|
33
33
|
disposeRoot = dispose;
|
|
34
34
|
return component();
|
|
35
35
|
});
|
|
@@ -55,7 +55,7 @@ function createSwitch(value2, cases, fallback) {
|
|
|
55
55
|
const cache2 = /* @__PURE__ */ new Map();
|
|
56
56
|
let currentNode = null;
|
|
57
57
|
let currentMatch = UNSET;
|
|
58
|
-
const switchDispose =
|
|
58
|
+
const switchDispose = chunkPAKPQRVE_cjs.internalEffect(() => {
|
|
59
59
|
const val = value2();
|
|
60
60
|
if (val === currentMatch) return;
|
|
61
61
|
const DEBUG = typeof globalThis.__FORMA_DEBUG__ !== "undefined";
|
|
@@ -90,9 +90,9 @@ function createSwitch(value2, cases, fallback) {
|
|
|
90
90
|
let entry = cache2.get(val);
|
|
91
91
|
if (!entry) {
|
|
92
92
|
let branchDispose;
|
|
93
|
-
const node =
|
|
93
|
+
const node = chunkPAKPQRVE_cjs.createRoot((dispose) => {
|
|
94
94
|
branchDispose = dispose;
|
|
95
|
-
return
|
|
95
|
+
return chunkPAKPQRVE_cjs.untrack(() => matchedCase.render());
|
|
96
96
|
});
|
|
97
97
|
entry = { node, dispose: branchDispose };
|
|
98
98
|
cache2.set(val, entry);
|
|
@@ -110,7 +110,7 @@ function createSwitch(value2, cases, fallback) {
|
|
|
110
110
|
if (DEBUG) console.log("[forma:switch] inserted", currentNode.nodeName, "before end marker");
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
|
-
|
|
113
|
+
chunkPAKPQRVE_cjs.registerDisposer(() => {
|
|
114
114
|
for (const entry of cache2.values()) {
|
|
115
115
|
entry.dispose();
|
|
116
116
|
}
|
|
@@ -142,7 +142,7 @@ function createPortal(children2, target) {
|
|
|
142
142
|
}
|
|
143
143
|
mountedNode = null;
|
|
144
144
|
};
|
|
145
|
-
|
|
145
|
+
chunkPAKPQRVE_cjs.createEffect(() => {
|
|
146
146
|
const node = children2();
|
|
147
147
|
removeMountedNode();
|
|
148
148
|
mountedNode = node;
|
|
@@ -161,9 +161,9 @@ function createErrorBoundary(tryFn, catchFn) {
|
|
|
161
161
|
const fragment2 = document.createDocumentFragment();
|
|
162
162
|
fragment2.appendChild(startMarker);
|
|
163
163
|
fragment2.appendChild(endMarker);
|
|
164
|
-
const [retryCount, setRetryCount] =
|
|
164
|
+
const [retryCount, setRetryCount] = chunkHAULTMNX_cjs.createSignal(0);
|
|
165
165
|
let currentNode = null;
|
|
166
|
-
|
|
166
|
+
chunkPAKPQRVE_cjs.internalEffect(() => {
|
|
167
167
|
retryCount();
|
|
168
168
|
const parent2 = startMarker.parentNode;
|
|
169
169
|
if (!parent2) return;
|
|
@@ -191,7 +191,7 @@ function createSuspense(fallback, children2) {
|
|
|
191
191
|
const fragment2 = document.createDocumentFragment();
|
|
192
192
|
fragment2.appendChild(startMarker);
|
|
193
193
|
fragment2.appendChild(endMarker);
|
|
194
|
-
const [pending, setPending] =
|
|
194
|
+
const [pending, setPending] = chunkHAULTMNX_cjs.createSignal(0);
|
|
195
195
|
let currentNode = null;
|
|
196
196
|
let resolvedNode = null;
|
|
197
197
|
let fallbackNode = null;
|
|
@@ -203,13 +203,13 @@ function createSuspense(fallback, children2) {
|
|
|
203
203
|
setPending((p) => Math.max(0, p - 1));
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
|
-
|
|
206
|
+
chunkPAKPQRVE_cjs.pushSuspenseContext(ctx);
|
|
207
207
|
try {
|
|
208
208
|
resolvedNode = children2();
|
|
209
209
|
} finally {
|
|
210
|
-
|
|
210
|
+
chunkPAKPQRVE_cjs.popSuspenseContext();
|
|
211
211
|
}
|
|
212
|
-
|
|
212
|
+
chunkPAKPQRVE_cjs.internalEffect(() => {
|
|
213
213
|
const parent2 = startMarker.parentNode;
|
|
214
214
|
if (!parent2) return;
|
|
215
215
|
const isPending = pending() > 0;
|
|
@@ -286,7 +286,7 @@ function activateIslands(registry) {
|
|
|
286
286
|
const componentName = root.getAttribute("data-forma-component");
|
|
287
287
|
const hydrateFn = registry[componentName];
|
|
288
288
|
if (!hydrateFn) {
|
|
289
|
-
if (
|
|
289
|
+
if (chunkHAULTMNX_cjs.__DEV__) console.warn(`[forma] No hydrate function for island "${componentName}" (id=${id})`);
|
|
290
290
|
root.setAttribute("data-forma-status", "error");
|
|
291
291
|
continue;
|
|
292
292
|
}
|
|
@@ -371,13 +371,13 @@ function hydrateIslandRoot(root, id, componentName, hydrateFn, sharedProps) {
|
|
|
371
371
|
const props = loadIslandProps(root, id, sharedProps);
|
|
372
372
|
root.setAttribute("data-forma-status", "hydrating");
|
|
373
373
|
let activeRoot = root;
|
|
374
|
-
|
|
375
|
-
activeRoot =
|
|
374
|
+
chunkPAKPQRVE_cjs.createUnownedRoot((dispose) => {
|
|
375
|
+
activeRoot = chunkD46EJ3VS_cjs.hydrateIsland(() => hydrateFn(root, props), root);
|
|
376
376
|
activeRoot.__formaDispose = dispose;
|
|
377
377
|
});
|
|
378
378
|
activeRoot.setAttribute("data-forma-status", "active");
|
|
379
379
|
} catch (err) {
|
|
380
|
-
if (
|
|
380
|
+
if (chunkHAULTMNX_cjs.__DEV__) console.error(`[forma] Island "${componentName}" (id=${id}) failed:`, err);
|
|
381
381
|
root.setAttribute("data-forma-status", "error");
|
|
382
382
|
}
|
|
383
383
|
}
|
|
@@ -404,6 +404,13 @@ function onUnmount(fn) {
|
|
|
404
404
|
}
|
|
405
405
|
currentLifecycleContext.unmountCallbacks.push(fn);
|
|
406
406
|
}
|
|
407
|
+
function registerContextDisposer(dispose) {
|
|
408
|
+
if (currentLifecycleContext !== null) {
|
|
409
|
+
currentLifecycleContext.contextDisposers.push(dispose);
|
|
410
|
+
return true;
|
|
411
|
+
}
|
|
412
|
+
return false;
|
|
413
|
+
}
|
|
407
414
|
var DISPOSE_KEY = /* @__PURE__ */ Symbol("forma:component:dispose");
|
|
408
415
|
function defineComponent(setupOrDef) {
|
|
409
416
|
const setup = typeof setupOrDef === "function" ? setupOrDef : setupOrDef.setup;
|
|
@@ -412,44 +419,75 @@ function defineComponent(setupOrDef) {
|
|
|
412
419
|
const ctx = {
|
|
413
420
|
disposers: [],
|
|
414
421
|
mountCallbacks: [],
|
|
415
|
-
unmountCallbacks: []
|
|
422
|
+
unmountCallbacks: [],
|
|
423
|
+
contextDisposers: []
|
|
416
424
|
};
|
|
417
425
|
pushLifecycleContext(ctx);
|
|
418
426
|
let dom;
|
|
419
427
|
try {
|
|
420
428
|
dom = setup();
|
|
429
|
+
} catch (e) {
|
|
430
|
+
for (let i = ctx.contextDisposers.length - 1; i >= 0; i--) {
|
|
431
|
+
try {
|
|
432
|
+
ctx.contextDisposers[i]();
|
|
433
|
+
} catch {
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
ctx.contextDisposers.length = 0;
|
|
437
|
+
throw e;
|
|
421
438
|
} finally {
|
|
422
439
|
popLifecycleContext();
|
|
423
440
|
}
|
|
441
|
+
let disposed = false;
|
|
424
442
|
const dispose = () => {
|
|
443
|
+
if (disposed) return;
|
|
444
|
+
disposed = true;
|
|
425
445
|
for (const cb of ctx.unmountCallbacks) {
|
|
426
446
|
try {
|
|
427
447
|
cb();
|
|
428
448
|
} catch (e) {
|
|
429
|
-
|
|
449
|
+
chunkHAULTMNX_cjs.reportError(e, "onUnmount");
|
|
430
450
|
}
|
|
431
451
|
}
|
|
432
452
|
for (const d of ctx.disposers) {
|
|
433
453
|
try {
|
|
434
454
|
d();
|
|
435
455
|
} catch (e) {
|
|
436
|
-
|
|
456
|
+
chunkHAULTMNX_cjs.reportError(e, "component disposer");
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
for (let i = ctx.contextDisposers.length - 1; i >= 0; i--) {
|
|
460
|
+
try {
|
|
461
|
+
ctx.contextDisposers[i]();
|
|
462
|
+
} catch (e) {
|
|
463
|
+
chunkHAULTMNX_cjs.reportError(e, "context disposer");
|
|
437
464
|
}
|
|
438
465
|
}
|
|
439
466
|
ctx.disposers.length = 0;
|
|
440
467
|
ctx.mountCallbacks.length = 0;
|
|
441
468
|
ctx.unmountCallbacks.length = 0;
|
|
469
|
+
ctx.contextDisposers.length = 0;
|
|
442
470
|
};
|
|
443
471
|
dom[DISPOSE_KEY] = dispose;
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
472
|
+
if (dom.nodeType === 11) {
|
|
473
|
+
for (const child of Array.from(dom.childNodes)) {
|
|
474
|
+
child[DISPOSE_KEY] = dispose;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
pushLifecycleContext(ctx);
|
|
478
|
+
try {
|
|
479
|
+
for (const cb of ctx.mountCallbacks) {
|
|
480
|
+
try {
|
|
481
|
+
const cleanup2 = cb();
|
|
482
|
+
if (typeof cleanup2 === "function") {
|
|
483
|
+
ctx.unmountCallbacks.push(cleanup2);
|
|
484
|
+
}
|
|
485
|
+
} catch (e) {
|
|
486
|
+
chunkHAULTMNX_cjs.reportError(e, "onMount");
|
|
449
487
|
}
|
|
450
|
-
} catch (e) {
|
|
451
|
-
chunkH7MDUHS5_cjs.reportError(e, "onMount");
|
|
452
488
|
}
|
|
489
|
+
} finally {
|
|
490
|
+
popLifecycleContext();
|
|
453
491
|
}
|
|
454
492
|
return dom;
|
|
455
493
|
};
|
|
@@ -469,6 +507,17 @@ function trackDisposer(dispose) {
|
|
|
469
507
|
|
|
470
508
|
// src/component/context.ts
|
|
471
509
|
var contextStacks = /* @__PURE__ */ new Map();
|
|
510
|
+
function removeFrame(id, token) {
|
|
511
|
+
const stack = contextStacks.get(id);
|
|
512
|
+
if (!stack) return;
|
|
513
|
+
for (let i = stack.length - 1; i >= 0; i--) {
|
|
514
|
+
if (stack[i].token === token) {
|
|
515
|
+
stack.splice(i, 1);
|
|
516
|
+
break;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
if (stack.length === 0) contextStacks.delete(id);
|
|
520
|
+
}
|
|
472
521
|
function createContext(defaultValue) {
|
|
473
522
|
return {
|
|
474
523
|
id: /* @__PURE__ */ Symbol("forma:context"),
|
|
@@ -481,14 +530,16 @@ function provide(ctx, value2) {
|
|
|
481
530
|
stack = [];
|
|
482
531
|
contextStacks.set(ctx.id, stack);
|
|
483
532
|
}
|
|
484
|
-
|
|
533
|
+
const token = /* @__PURE__ */ Symbol("forma:context-frame");
|
|
534
|
+
stack.push({ token, value: value2 });
|
|
535
|
+
registerContextDisposer(() => removeFrame(ctx.id, token));
|
|
485
536
|
}
|
|
486
537
|
function inject(ctx) {
|
|
487
538
|
const stack = contextStacks.get(ctx.id);
|
|
488
539
|
if (stack === void 0 || stack.length === 0) {
|
|
489
540
|
return ctx.defaultValue;
|
|
490
541
|
}
|
|
491
|
-
return stack[stack.length - 1];
|
|
542
|
+
return stack[stack.length - 1].value;
|
|
492
543
|
}
|
|
493
544
|
function unprovide(ctx) {
|
|
494
545
|
const stack = contextStacks.get(ctx.id);
|
|
@@ -541,7 +592,7 @@ function createStore(initial) {
|
|
|
541
592
|
function getArrayVersion(path) {
|
|
542
593
|
let p = arrayVersions.get(path);
|
|
543
594
|
if (!p) {
|
|
544
|
-
p =
|
|
595
|
+
p = chunkHAULTMNX_cjs.createSignal(0);
|
|
545
596
|
arrayVersions.set(path, p);
|
|
546
597
|
}
|
|
547
598
|
return p;
|
|
@@ -564,7 +615,7 @@ function createStore(initial) {
|
|
|
564
615
|
function getSignal(path, initialValue) {
|
|
565
616
|
let pair = signals.get(path);
|
|
566
617
|
if (!pair) {
|
|
567
|
-
pair =
|
|
618
|
+
pair = chunkHAULTMNX_cjs.createSignal(initialValue);
|
|
568
619
|
signals.set(path, pair);
|
|
569
620
|
registerChild(path);
|
|
570
621
|
}
|
|
@@ -586,7 +637,7 @@ function createStore(initial) {
|
|
|
586
637
|
return d === -1 ? path : path.substring(d + 1);
|
|
587
638
|
}
|
|
588
639
|
function setLiteral(pair, v) {
|
|
589
|
-
pair[1](typeof v === "function" ?
|
|
640
|
+
pair[1](typeof v === "function" ? chunkHAULTMNX_cjs.value(v) : v);
|
|
590
641
|
}
|
|
591
642
|
function reconcileChildren(parentPath, rawParent) {
|
|
592
643
|
const set = children2.get(parentPath);
|
|
@@ -627,7 +678,7 @@ function createStore(initial) {
|
|
|
627
678
|
if (isArr && ARRAY_MUTATORS.has(key)) {
|
|
628
679
|
return (...args) => {
|
|
629
680
|
let result;
|
|
630
|
-
|
|
681
|
+
chunkPAKPQRVE_cjs.batch(() => {
|
|
631
682
|
const rawArgs = args.map(
|
|
632
683
|
(a) => a != null && typeof a === "object" && a[RAW] ? a[RAW] : a
|
|
633
684
|
);
|
|
@@ -680,7 +731,7 @@ function createStore(initial) {
|
|
|
680
731
|
}
|
|
681
732
|
}
|
|
682
733
|
if (isArr && key === "length") {
|
|
683
|
-
|
|
734
|
+
chunkPAKPQRVE_cjs.batch(() => {
|
|
684
735
|
reconcileChildren(basePath, target);
|
|
685
736
|
if (basePath) bumpArrayVersion(basePath);
|
|
686
737
|
});
|
|
@@ -749,11 +800,11 @@ function createStore(initial) {
|
|
|
749
800
|
}
|
|
750
801
|
const rootProxy = wrap(initial, "");
|
|
751
802
|
function getCurrentSnapshot() {
|
|
752
|
-
return
|
|
803
|
+
return chunkPAKPQRVE_cjs.untrack(() => deepClone(initial));
|
|
753
804
|
}
|
|
754
805
|
const setter = (partial) => {
|
|
755
806
|
const updates = typeof partial === "function" ? partial(getCurrentSnapshot()) : partial;
|
|
756
|
-
|
|
807
|
+
chunkPAKPQRVE_cjs.batch(() => {
|
|
757
808
|
for (const key of Object.keys(updates)) {
|
|
758
809
|
rootProxy[key] = updates[key];
|
|
759
810
|
}
|
|
@@ -782,11 +833,11 @@ function createHistory(source, options) {
|
|
|
782
833
|
const maxLength = Math.max(1, options?.maxLength ?? 100);
|
|
783
834
|
let _stack = [cloneEntry(sourceGet())];
|
|
784
835
|
let _cursor = 0;
|
|
785
|
-
const [stackSignal, setStackSignal] =
|
|
786
|
-
const [cursorSignal, setCursorSignal] =
|
|
787
|
-
const [stackLenSignal, setStackLenSignal] =
|
|
836
|
+
const [stackSignal, setStackSignal] = chunkHAULTMNX_cjs.createSignal([..._stack]);
|
|
837
|
+
const [cursorSignal, setCursorSignal] = chunkHAULTMNX_cjs.createSignal(_cursor);
|
|
838
|
+
const [stackLenSignal, setStackLenSignal] = chunkHAULTMNX_cjs.createSignal(_stack.length);
|
|
788
839
|
function syncSignals() {
|
|
789
|
-
|
|
840
|
+
chunkPAKPQRVE_cjs.batch(() => {
|
|
790
841
|
setStackSignal([..._stack]);
|
|
791
842
|
setCursorSignal(_cursor);
|
|
792
843
|
setStackLenSignal(_stack.length);
|
|
@@ -795,7 +846,7 @@ function createHistory(source, options) {
|
|
|
795
846
|
const NONE = /* @__PURE__ */ Symbol("none");
|
|
796
847
|
let _expected = NONE;
|
|
797
848
|
let isFirstRun = true;
|
|
798
|
-
const disposeEffect =
|
|
849
|
+
const disposeEffect = chunkPAKPQRVE_cjs.internalEffect(() => {
|
|
799
850
|
const value2 = sourceGet();
|
|
800
851
|
if (isFirstRun) {
|
|
801
852
|
isFirstRun = false;
|
|
@@ -907,7 +958,7 @@ function persist(source, key, options) {
|
|
|
907
958
|
}
|
|
908
959
|
}
|
|
909
960
|
hydrate();
|
|
910
|
-
const stopEffect =
|
|
961
|
+
const stopEffect = chunkPAKPQRVE_cjs.internalEffect(() => {
|
|
911
962
|
const value2 = sourceGet();
|
|
912
963
|
if (writing) return;
|
|
913
964
|
try {
|
|
@@ -1183,119 +1234,135 @@ function onMutation(el, handler, options) {
|
|
|
1183
1234
|
|
|
1184
1235
|
Object.defineProperty(exports, "Fragment", {
|
|
1185
1236
|
enumerable: true,
|
|
1186
|
-
get: function () { return
|
|
1237
|
+
get: function () { return chunkD46EJ3VS_cjs.Fragment; }
|
|
1187
1238
|
});
|
|
1188
1239
|
Object.defineProperty(exports, "cleanup", {
|
|
1189
1240
|
enumerable: true,
|
|
1190
|
-
get: function () { return
|
|
1241
|
+
get: function () { return chunkD46EJ3VS_cjs.cleanup; }
|
|
1191
1242
|
});
|
|
1192
1243
|
Object.defineProperty(exports, "createList", {
|
|
1193
1244
|
enumerable: true,
|
|
1194
|
-
get: function () { return
|
|
1245
|
+
get: function () { return chunkD46EJ3VS_cjs.createList; }
|
|
1195
1246
|
});
|
|
1196
1247
|
Object.defineProperty(exports, "createShow", {
|
|
1197
1248
|
enumerable: true,
|
|
1198
|
-
get: function () { return
|
|
1249
|
+
get: function () { return chunkD46EJ3VS_cjs.createShow; }
|
|
1199
1250
|
});
|
|
1200
1251
|
Object.defineProperty(exports, "fragment", {
|
|
1201
1252
|
enumerable: true,
|
|
1202
|
-
get: function () { return
|
|
1253
|
+
get: function () { return chunkD46EJ3VS_cjs.fragment; }
|
|
1203
1254
|
});
|
|
1204
1255
|
Object.defineProperty(exports, "h", {
|
|
1205
1256
|
enumerable: true,
|
|
1206
|
-
get: function () { return
|
|
1257
|
+
get: function () { return chunkD46EJ3VS_cjs.h; }
|
|
1207
1258
|
});
|
|
1208
1259
|
Object.defineProperty(exports, "hydrateIsland", {
|
|
1209
1260
|
enumerable: true,
|
|
1210
|
-
get: function () { return
|
|
1261
|
+
get: function () { return chunkD46EJ3VS_cjs.hydrateIsland; }
|
|
1211
1262
|
});
|
|
1212
1263
|
Object.defineProperty(exports, "reconcileList", {
|
|
1213
1264
|
enumerable: true,
|
|
1214
|
-
get: function () { return
|
|
1265
|
+
get: function () { return chunkD46EJ3VS_cjs.reconcileList; }
|
|
1215
1266
|
});
|
|
1216
1267
|
Object.defineProperty(exports, "svg", {
|
|
1217
1268
|
enumerable: true,
|
|
1218
|
-
get: function () { return
|
|
1269
|
+
get: function () { return chunkD46EJ3VS_cjs.svg; }
|
|
1219
1270
|
});
|
|
1220
1271
|
Object.defineProperty(exports, "batch", {
|
|
1221
1272
|
enumerable: true,
|
|
1222
|
-
get: function () { return
|
|
1273
|
+
get: function () { return chunkPAKPQRVE_cjs.batch; }
|
|
1223
1274
|
});
|
|
1224
1275
|
Object.defineProperty(exports, "createEffect", {
|
|
1225
1276
|
enumerable: true,
|
|
1226
|
-
get: function () { return
|
|
1277
|
+
get: function () { return chunkPAKPQRVE_cjs.createEffect; }
|
|
1227
1278
|
});
|
|
1228
1279
|
Object.defineProperty(exports, "createMemo", {
|
|
1229
1280
|
enumerable: true,
|
|
1230
|
-
get: function () { return
|
|
1281
|
+
get: function () { return chunkPAKPQRVE_cjs.createMemo; }
|
|
1231
1282
|
});
|
|
1232
1283
|
Object.defineProperty(exports, "createReducer", {
|
|
1233
1284
|
enumerable: true,
|
|
1234
|
-
get: function () { return
|
|
1285
|
+
get: function () { return chunkPAKPQRVE_cjs.createReducer; }
|
|
1235
1286
|
});
|
|
1236
1287
|
Object.defineProperty(exports, "createRef", {
|
|
1237
1288
|
enumerable: true,
|
|
1238
|
-
get: function () { return
|
|
1289
|
+
get: function () { return chunkPAKPQRVE_cjs.createRef; }
|
|
1239
1290
|
});
|
|
1240
1291
|
Object.defineProperty(exports, "createResource", {
|
|
1241
1292
|
enumerable: true,
|
|
1242
|
-
get: function () { return
|
|
1293
|
+
get: function () { return chunkPAKPQRVE_cjs.createResource; }
|
|
1243
1294
|
});
|
|
1244
1295
|
Object.defineProperty(exports, "createRoot", {
|
|
1245
1296
|
enumerable: true,
|
|
1246
|
-
get: function () { return
|
|
1297
|
+
get: function () { return chunkPAKPQRVE_cjs.createRoot; }
|
|
1247
1298
|
});
|
|
1248
1299
|
Object.defineProperty(exports, "createUnownedRoot", {
|
|
1249
1300
|
enumerable: true,
|
|
1250
|
-
get: function () { return
|
|
1301
|
+
get: function () { return chunkPAKPQRVE_cjs.createUnownedRoot; }
|
|
1251
1302
|
});
|
|
1252
1303
|
Object.defineProperty(exports, "getBatchDepth", {
|
|
1253
1304
|
enumerable: true,
|
|
1254
|
-
get: function () { return
|
|
1305
|
+
get: function () { return chunkPAKPQRVE_cjs.getBatchDepth; }
|
|
1306
|
+
});
|
|
1307
|
+
Object.defineProperty(exports, "getOwner", {
|
|
1308
|
+
enumerable: true,
|
|
1309
|
+
get: function () { return chunkPAKPQRVE_cjs.getOwner; }
|
|
1255
1310
|
});
|
|
1256
1311
|
Object.defineProperty(exports, "isComputed", {
|
|
1257
1312
|
enumerable: true,
|
|
1258
|
-
get: function () { return
|
|
1313
|
+
get: function () { return chunkPAKPQRVE_cjs.isComputed; }
|
|
1259
1314
|
});
|
|
1260
1315
|
Object.defineProperty(exports, "isEffect", {
|
|
1261
1316
|
enumerable: true,
|
|
1262
|
-
get: function () { return
|
|
1317
|
+
get: function () { return chunkPAKPQRVE_cjs.isEffect; }
|
|
1263
1318
|
});
|
|
1264
1319
|
Object.defineProperty(exports, "isEffectScope", {
|
|
1265
1320
|
enumerable: true,
|
|
1266
|
-
get: function () { return
|
|
1321
|
+
get: function () { return chunkPAKPQRVE_cjs.isEffectScope; }
|
|
1267
1322
|
});
|
|
1268
1323
|
Object.defineProperty(exports, "isSignal", {
|
|
1269
1324
|
enumerable: true,
|
|
1270
|
-
get: function () { return
|
|
1325
|
+
get: function () { return chunkPAKPQRVE_cjs.isSignal; }
|
|
1271
1326
|
});
|
|
1272
1327
|
Object.defineProperty(exports, "on", {
|
|
1273
1328
|
enumerable: true,
|
|
1274
|
-
get: function () { return
|
|
1329
|
+
get: function () { return chunkPAKPQRVE_cjs.on; }
|
|
1275
1330
|
});
|
|
1276
1331
|
Object.defineProperty(exports, "onCleanup", {
|
|
1277
1332
|
enumerable: true,
|
|
1278
|
-
get: function () { return
|
|
1333
|
+
get: function () { return chunkPAKPQRVE_cjs.onCleanup; }
|
|
1334
|
+
});
|
|
1335
|
+
Object.defineProperty(exports, "runWithOwner", {
|
|
1336
|
+
enumerable: true,
|
|
1337
|
+
get: function () { return chunkPAKPQRVE_cjs.runWithOwner; }
|
|
1279
1338
|
});
|
|
1280
1339
|
Object.defineProperty(exports, "trigger", {
|
|
1281
1340
|
enumerable: true,
|
|
1282
|
-
get: function () { return
|
|
1341
|
+
get: function () { return chunkPAKPQRVE_cjs.trigger; }
|
|
1283
1342
|
});
|
|
1284
1343
|
Object.defineProperty(exports, "untrack", {
|
|
1285
1344
|
enumerable: true,
|
|
1286
|
-
get: function () { return
|
|
1345
|
+
get: function () { return chunkPAKPQRVE_cjs.untrack; }
|
|
1287
1346
|
});
|
|
1288
1347
|
Object.defineProperty(exports, "createComputed", {
|
|
1289
1348
|
enumerable: true,
|
|
1290
|
-
get: function () { return
|
|
1349
|
+
get: function () { return chunkHAULTMNX_cjs.createComputed; }
|
|
1291
1350
|
});
|
|
1292
1351
|
Object.defineProperty(exports, "createSignal", {
|
|
1293
1352
|
enumerable: true,
|
|
1294
|
-
get: function () { return
|
|
1353
|
+
get: function () { return chunkHAULTMNX_cjs.createSignal; }
|
|
1354
|
+
});
|
|
1355
|
+
Object.defineProperty(exports, "getSignalName", {
|
|
1356
|
+
enumerable: true,
|
|
1357
|
+
get: function () { return chunkHAULTMNX_cjs.getSignalName; }
|
|
1295
1358
|
});
|
|
1296
1359
|
Object.defineProperty(exports, "onError", {
|
|
1297
1360
|
enumerable: true,
|
|
1298
|
-
get: function () { return
|
|
1361
|
+
get: function () { return chunkHAULTMNX_cjs.onError; }
|
|
1362
|
+
});
|
|
1363
|
+
Object.defineProperty(exports, "value", {
|
|
1364
|
+
enumerable: true,
|
|
1365
|
+
get: function () { return chunkHAULTMNX_cjs.value; }
|
|
1299
1366
|
});
|
|
1300
1367
|
exports.$ = $;
|
|
1301
1368
|
exports.$$ = $$;
|