@graphrefly/graphrefly 0.14.0 → 0.16.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-2ZICUAUJ.js → chunk-26A4E7J7.js} +10 -12
- package/dist/chunk-26A4E7J7.js.map +1 -0
- package/dist/{chunk-CRACCCJY.js → chunk-3BLRREFM.js} +29 -5
- package/dist/chunk-3BLRREFM.js.map +1 -0
- package/dist/{chunk-XQ4UMAU7.js → chunk-ITDVOCFO.js} +2 -2
- package/dist/{chunk-YW6LFCFS.js → chunk-LKP7IWRV.js} +3 -3
- package/dist/{chunk-4APC3AFN.js → chunk-RLVFZDCE.js} +22 -49
- package/dist/chunk-RLVFZDCE.js.map +1 -0
- package/dist/{chunk-GKRKDYNT.js → chunk-RZSQ7P2C.js} +3 -3
- package/dist/{chunk-ZHTHUX5D.js → chunk-SHRJH2DN.js} +3 -3
- package/dist/{chunk-H243FWYP.js → chunk-VZY2B2LU.js} +1 -1
- package/dist/{chunk-H243FWYP.js.map → chunk-VZY2B2LU.js.map} +1 -1
- package/dist/{chunk-QVYZD65U.js → chunk-YX263TXI.js} +10 -38
- package/dist/chunk-YX263TXI.js.map +1 -0
- package/dist/compat/nestjs/index.cjs +38 -41
- package/dist/compat/nestjs/index.cjs.map +1 -1
- package/dist/compat/nestjs/index.d.cts +4 -4
- package/dist/compat/nestjs/index.d.ts +4 -4
- package/dist/compat/nestjs/index.js +7 -7
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +3 -3
- package/dist/extra/index.cjs +27 -78
- package/dist/extra/index.cjs.map +1 -1
- package/dist/extra/index.d.cts +4 -4
- package/dist/extra/index.d.ts +4 -4
- package/dist/extra/index.js +3 -3
- package/dist/graph/index.cjs +26 -2
- package/dist/graph/index.cjs.map +1 -1
- package/dist/graph/index.d.cts +3 -3
- package/dist/graph/index.d.ts +3 -3
- package/dist/graph/index.js +4 -4
- package/dist/{graph-BXIK5Dq5.d.ts → graph-Dc-P9BVm.d.ts} +15 -3
- package/dist/{graph-BhADtuFU.d.cts → graph-fCsaaVIa.d.cts} +15 -3
- package/dist/{index-DSp5R3Xq.d.ts → index-BBVBYPxr.d.cts} +4 -4
- package/dist/{index-BkToATim.d.ts → index-BR19vQME.d.ts} +1 -1
- package/dist/{index-BNB0KjKe.d.ts → index-BmoUvOGN.d.ts} +1 -1
- package/dist/{index-DBhLjWSV.d.cts → index-ClaKZFPl.d.cts} +100 -31
- package/dist/{index-Dqemj9q0.d.cts → index-DWq0P9T6.d.ts} +4 -4
- package/dist/{index-Wa8jXne6.d.cts → index-Db27z6Ki.d.cts} +1 -1
- package/dist/{index-fYObbpUw.d.ts → index-DhXznWyH.d.ts} +2 -2
- package/dist/{index-DANO9Gg7.d.cts → index-DlGMf_Qe.d.cts} +2 -2
- package/dist/{index-CKyYg4IP.d.ts → index-N704txAA.d.ts} +100 -31
- package/dist/{index-DKIyo4Bq.d.cts → index-YlOH1Gw6.d.cts} +1 -1
- package/dist/index.cjs +185 -224
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +35 -39
- package/dist/index.d.ts +35 -39
- package/dist/index.js +143 -153
- package/dist/index.js.map +1 -1
- package/dist/{meta-CrZUQAJ6.d.cts → meta-BV4pj9ML.d.cts} +6 -0
- package/dist/{meta-CrZUQAJ6.d.ts → meta-BV4pj9ML.d.ts} +6 -0
- package/dist/observable-Cz-AWhwR.d.cts +42 -0
- package/dist/observable-DCqlwGyl.d.ts +42 -0
- package/dist/patterns/reactive-layout/index.cjs +26 -2
- package/dist/patterns/reactive-layout/index.cjs.map +1 -1
- package/dist/patterns/reactive-layout/index.d.cts +3 -3
- package/dist/patterns/reactive-layout/index.d.ts +3 -3
- package/dist/patterns/reactive-layout/index.js +4 -4
- package/package.json +3 -2
- package/dist/chunk-2ZICUAUJ.js.map +0 -1
- package/dist/chunk-4APC3AFN.js.map +0 -1
- package/dist/chunk-CRACCCJY.js.map +0 -1
- package/dist/chunk-QVYZD65U.js.map +0 -1
- package/dist/reactive-log-ChbpUrY2.d.cts +0 -137
- package/dist/reactive-log-DV--7BWd.d.ts +0 -137
- /package/dist/{chunk-XQ4UMAU7.js.map → chunk-ITDVOCFO.js.map} +0 -0
- /package/dist/{chunk-YW6LFCFS.js.map → chunk-LKP7IWRV.js.map} +0 -0
- /package/dist/{chunk-GKRKDYNT.js.map → chunk-RZSQ7P2C.js.map} +0 -0
- /package/dist/{chunk-ZHTHUX5D.js.map → chunk-SHRJH2DN.js.map} +0 -0
package/dist/core/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { A as Actor, C as CLEANUP_RESULT, d as COMPLETE, e as CleanupResult, D as DATA, f as DEFAULT_ACTOR, g as DIRTY, h as DescribeDetail, i as DescribeField, j as DescribeNodeOutput, E as ERROR, G as GuardAction, k as GuardDenied, l as GuardDeniedDetails, H as HashFn, I as INVALIDATE, M as Message, m as Messages, N as Node, b as NodeActions, n as NodeDescribeKind, c as NodeFn, o as NodeGuard, a as NodeOptions, p as NodeSink, q as NodeStatus, r as NodeTransportOptions, s as NodeVersionInfo, O as OnMessageHandler, P as PAUSE, t as PolicyAllow, u as PolicyDeny, v as PolicyRuleData, R as RESOLVED, w as RESUME, S as SubscribeHints, T as TEARDOWN, V as V0, x as V1, y as VersioningLevel, z as VersioningOptions, B as accessHintForGuard, F as advanceVersion, J as cleanupResult, K as createVersioning, L as defaultHash, Q as describeNode, U as isKnownMessageType, W as isPhase2Message, X as isTerminalMessage, Y as isV1, Z as knownMessageTypes, _ as messageTier, $ as metaSnapshot, a0 as node, a1 as normalizeActor, a2 as policy, a3 as policyFromRules, a4 as propagatesToMeta, a5 as resolveDescribeFields } from '../meta-
|
|
2
|
-
export { B as BridgeOptions, D as DEFAULT_DOWN, a as DownStrategy, b as DynGet, c as DynamicNodeFn, d as DynamicNodeImpl, e as DynamicNodeOptions, P as PipeOperator, R as ResettableTimer, f as batch, g as bridge, h as derived, j as downWithBatch, k as dynamicNode, l as effect, m as isBatching, n as monotonicNs, p as partitionForBatch, o as pipe, q as producer, s as state, w as wallClockNs } from '../index-
|
|
1
|
+
export { A as Actor, C as CLEANUP_RESULT, d as COMPLETE, e as CleanupResult, D as DATA, f as DEFAULT_ACTOR, g as DIRTY, h as DescribeDetail, i as DescribeField, j as DescribeNodeOutput, E as ERROR, G as GuardAction, k as GuardDenied, l as GuardDeniedDetails, H as HashFn, I as INVALIDATE, M as Message, m as Messages, N as Node, b as NodeActions, n as NodeDescribeKind, c as NodeFn, o as NodeGuard, a as NodeOptions, p as NodeSink, q as NodeStatus, r as NodeTransportOptions, s as NodeVersionInfo, O as OnMessageHandler, P as PAUSE, t as PolicyAllow, u as PolicyDeny, v as PolicyRuleData, R as RESOLVED, w as RESUME, S as SubscribeHints, T as TEARDOWN, V as V0, x as V1, y as VersioningLevel, z as VersioningOptions, B as accessHintForGuard, F as advanceVersion, J as cleanupResult, K as createVersioning, L as defaultHash, Q as describeNode, U as isKnownMessageType, W as isPhase2Message, X as isTerminalMessage, Y as isV1, Z as knownMessageTypes, _ as messageTier, $ as metaSnapshot, a0 as node, a1 as normalizeActor, a2 as policy, a3 as policyFromRules, a4 as propagatesToMeta, a5 as resolveDescribeFields } from '../meta-BV4pj9ML.cjs';
|
|
2
|
+
export { B as BridgeOptions, D as DEFAULT_DOWN, a as DownStrategy, b as DynGet, c as DynamicNodeFn, d as DynamicNodeImpl, e as DynamicNodeOptions, P as PipeOperator, R as ResettableTimer, f as batch, g as bridge, h as derived, j as downWithBatch, k as dynamicNode, l as effect, m as isBatching, n as monotonicNs, p as partitionForBatch, o as pipe, q as producer, s as state, w as wallClockNs } from '../index-YlOH1Gw6.cjs';
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { A as Actor, C as CLEANUP_RESULT, d as COMPLETE, e as CleanupResult, D as DATA, f as DEFAULT_ACTOR, g as DIRTY, h as DescribeDetail, i as DescribeField, j as DescribeNodeOutput, E as ERROR, G as GuardAction, k as GuardDenied, l as GuardDeniedDetails, H as HashFn, I as INVALIDATE, M as Message, m as Messages, N as Node, b as NodeActions, n as NodeDescribeKind, c as NodeFn, o as NodeGuard, a as NodeOptions, p as NodeSink, q as NodeStatus, r as NodeTransportOptions, s as NodeVersionInfo, O as OnMessageHandler, P as PAUSE, t as PolicyAllow, u as PolicyDeny, v as PolicyRuleData, R as RESOLVED, w as RESUME, S as SubscribeHints, T as TEARDOWN, V as V0, x as V1, y as VersioningLevel, z as VersioningOptions, B as accessHintForGuard, F as advanceVersion, J as cleanupResult, K as createVersioning, L as defaultHash, Q as describeNode, U as isKnownMessageType, W as isPhase2Message, X as isTerminalMessage, Y as isV1, Z as knownMessageTypes, _ as messageTier, $ as metaSnapshot, a0 as node, a1 as normalizeActor, a2 as policy, a3 as policyFromRules, a4 as propagatesToMeta, a5 as resolveDescribeFields } from '../meta-
|
|
2
|
-
export { B as BridgeOptions, D as DEFAULT_DOWN, a as DownStrategy, b as DynGet, c as DynamicNodeFn, d as DynamicNodeImpl, e as DynamicNodeOptions, P as PipeOperator, R as ResettableTimer, f as batch, g as bridge, h as derived, j as downWithBatch, k as dynamicNode, l as effect, m as isBatching, n as monotonicNs, p as partitionForBatch, o as pipe, q as producer, s as state, w as wallClockNs } from '../index-
|
|
1
|
+
export { A as Actor, C as CLEANUP_RESULT, d as COMPLETE, e as CleanupResult, D as DATA, f as DEFAULT_ACTOR, g as DIRTY, h as DescribeDetail, i as DescribeField, j as DescribeNodeOutput, E as ERROR, G as GuardAction, k as GuardDenied, l as GuardDeniedDetails, H as HashFn, I as INVALIDATE, M as Message, m as Messages, N as Node, b as NodeActions, n as NodeDescribeKind, c as NodeFn, o as NodeGuard, a as NodeOptions, p as NodeSink, q as NodeStatus, r as NodeTransportOptions, s as NodeVersionInfo, O as OnMessageHandler, P as PAUSE, t as PolicyAllow, u as PolicyDeny, v as PolicyRuleData, R as RESOLVED, w as RESUME, S as SubscribeHints, T as TEARDOWN, V as V0, x as V1, y as VersioningLevel, z as VersioningOptions, B as accessHintForGuard, F as advanceVersion, J as cleanupResult, K as createVersioning, L as defaultHash, Q as describeNode, U as isKnownMessageType, W as isPhase2Message, X as isTerminalMessage, Y as isV1, Z as knownMessageTypes, _ as messageTier, $ as metaSnapshot, a0 as node, a1 as normalizeActor, a2 as policy, a3 as policyFromRules, a4 as propagatesToMeta, a5 as resolveDescribeFields } from '../meta-BV4pj9ML.js';
|
|
2
|
+
export { B as BridgeOptions, D as DEFAULT_DOWN, a as DownStrategy, b as DynGet, c as DynamicNodeFn, d as DynamicNodeImpl, e as DynamicNodeOptions, P as PipeOperator, R as ResettableTimer, f as batch, g as bridge, h as derived, j as downWithBatch, k as dynamicNode, l as effect, m as isBatching, n as monotonicNs, p as partitionForBatch, o as pipe, q as producer, s as state, w as wallClockNs } from '../index-BmoUvOGN.js';
|
package/dist/core/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_DOWN,
|
|
3
3
|
bridge
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-LKP7IWRV.js";
|
|
5
5
|
import {
|
|
6
6
|
ResettableTimer
|
|
7
7
|
} from "../chunk-WZ2Z2CRV.js";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
describeNode,
|
|
10
10
|
metaSnapshot,
|
|
11
11
|
resolveDescribeFields
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-ITDVOCFO.js";
|
|
13
13
|
import {
|
|
14
14
|
CLEANUP_RESULT,
|
|
15
15
|
COMPLETE,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
propagatesToMeta,
|
|
53
53
|
state,
|
|
54
54
|
wallClockNs
|
|
55
|
-
} from "../chunk-
|
|
55
|
+
} from "../chunk-VZY2B2LU.js";
|
|
56
56
|
export {
|
|
57
57
|
CLEANUP_RESULT,
|
|
58
58
|
COMPLETE,
|
package/dist/extra/index.cjs
CHANGED
|
@@ -7205,25 +7205,7 @@ var debounceTime = debounce;
|
|
|
7205
7205
|
var throttleTime = throttle;
|
|
7206
7206
|
var catchError = rescue;
|
|
7207
7207
|
|
|
7208
|
-
// src/extra/reactive-base.ts
|
|
7209
|
-
function snapshotEqualsVersion(a, b) {
|
|
7210
|
-
if (typeof a !== "object" || a == null || typeof b !== "object" || b == null) {
|
|
7211
|
-
return Object.is(a, b);
|
|
7212
|
-
}
|
|
7213
|
-
if (!("version" in a) || !("version" in b)) return Object.is(a, b);
|
|
7214
|
-
return a.version === b.version;
|
|
7215
|
-
}
|
|
7216
|
-
function bumpVersion(current, nextValue, v0) {
|
|
7217
|
-
if (v0 != null) {
|
|
7218
|
-
return { version: current.version + 1, value: nextValue, v0 };
|
|
7219
|
-
}
|
|
7220
|
-
return { version: current.version + 1, value: nextValue };
|
|
7221
|
-
}
|
|
7222
|
-
|
|
7223
7208
|
// src/extra/reactive-map.ts
|
|
7224
|
-
function emptySnapshot() {
|
|
7225
|
-
return { version: 0, value: { map: /* @__PURE__ */ new Map() } };
|
|
7226
|
-
}
|
|
7227
7209
|
function isExpired(e, now) {
|
|
7228
7210
|
return e.expiresAt !== void 0 && now >= e.expiresAt;
|
|
7229
7211
|
}
|
|
@@ -7237,12 +7219,12 @@ function buildMap(store, now) {
|
|
|
7237
7219
|
function reactiveMap(options = {}) {
|
|
7238
7220
|
const { name, maxSize, defaultTtl, ...nodeOpts } = options;
|
|
7239
7221
|
const store = /* @__PURE__ */ new Map();
|
|
7240
|
-
|
|
7241
|
-
const n = state(current, {
|
|
7222
|
+
const n = state(/* @__PURE__ */ new Map(), {
|
|
7242
7223
|
...nodeOpts,
|
|
7243
7224
|
name,
|
|
7244
7225
|
describeKind: "state",
|
|
7245
|
-
equals:
|
|
7226
|
+
equals: (a, b) => a === b
|
|
7227
|
+
// identity; pushSnapshot always creates a new Map
|
|
7246
7228
|
});
|
|
7247
7229
|
function pruneExpiredInternal() {
|
|
7248
7230
|
const now = monotonicNs();
|
|
@@ -7267,11 +7249,9 @@ function reactiveMap(options = {}) {
|
|
|
7267
7249
|
pruneExpiredInternal();
|
|
7268
7250
|
const now = monotonicNs();
|
|
7269
7251
|
const map2 = buildMap(store, now);
|
|
7270
|
-
const nv = n.v;
|
|
7271
|
-
current = bumpVersion(current, { map: map2 }, nv ? { id: nv.id, version: nv.version } : void 0);
|
|
7272
7252
|
batch(() => {
|
|
7273
7253
|
n.down([[DIRTY]]);
|
|
7274
|
-
n.down([[DATA,
|
|
7254
|
+
n.down([[DATA, map2]]);
|
|
7275
7255
|
});
|
|
7276
7256
|
}
|
|
7277
7257
|
function touchLru(key) {
|
|
@@ -7281,7 +7261,7 @@ function reactiveMap(options = {}) {
|
|
|
7281
7261
|
store.set(key, e);
|
|
7282
7262
|
}
|
|
7283
7263
|
const bundle = {
|
|
7284
|
-
|
|
7264
|
+
entries: n,
|
|
7285
7265
|
get(key) {
|
|
7286
7266
|
const now = monotonicNs();
|
|
7287
7267
|
const e = store.get(key);
|
|
@@ -7378,13 +7358,11 @@ function keepalive(node2) {
|
|
|
7378
7358
|
node2.subscribe(() => void 0);
|
|
7379
7359
|
}
|
|
7380
7360
|
function mapFromSnapshot(snapshot) {
|
|
7381
|
-
if (
|
|
7382
|
-
return snapshot.value.map ?? /* @__PURE__ */ new Map();
|
|
7383
|
-
}
|
|
7361
|
+
if (snapshot instanceof Map) return snapshot;
|
|
7384
7362
|
return /* @__PURE__ */ new Map();
|
|
7385
7363
|
}
|
|
7386
7364
|
function asReadonlyMap(store) {
|
|
7387
|
-
return mapFromSnapshot(store.
|
|
7365
|
+
return mapFromSnapshot(store.entries.get());
|
|
7388
7366
|
}
|
|
7389
7367
|
function applyExtraction(store, extraction) {
|
|
7390
7368
|
if (!Array.isArray(extraction.upsert)) {
|
|
@@ -7412,7 +7390,7 @@ function distill(source, extractFn, opts) {
|
|
|
7412
7390
|
if (opts.evict) {
|
|
7413
7391
|
const evictionKeys = dynamicNode((get) => {
|
|
7414
7392
|
const out = [];
|
|
7415
|
-
const snapshot = mapFromSnapshot(get(store.
|
|
7393
|
+
const snapshot = mapFromSnapshot(get(store.entries));
|
|
7416
7394
|
for (const [key, mem] of snapshot) {
|
|
7417
7395
|
const verdict = opts.evict(key, mem);
|
|
7418
7396
|
if (isNodeLike(verdict)) {
|
|
@@ -7442,7 +7420,7 @@ function distill(source, extractFn, opts) {
|
|
|
7442
7420
|
applyExtraction(store, extraction);
|
|
7443
7421
|
});
|
|
7444
7422
|
}
|
|
7445
|
-
const compact = derived([store.
|
|
7423
|
+
const compact = derived([store.entries, contextNode], ([snapshot, context]) => {
|
|
7446
7424
|
const entries = [...mapFromSnapshot(snapshot).entries()].map(([key, value]) => ({
|
|
7447
7425
|
key,
|
|
7448
7426
|
value,
|
|
@@ -7460,7 +7438,7 @@ function distill(source, extractFn, opts) {
|
|
|
7460
7438
|
}
|
|
7461
7439
|
return packed;
|
|
7462
7440
|
});
|
|
7463
|
-
const size = derived([store.
|
|
7441
|
+
const size = derived([store.entries], ([snapshot]) => mapFromSnapshot(snapshot).size);
|
|
7464
7442
|
keepalive(compact);
|
|
7465
7443
|
keepalive(size);
|
|
7466
7444
|
return { store, compact, size };
|
|
@@ -7568,9 +7546,6 @@ function pubsub() {
|
|
|
7568
7546
|
}
|
|
7569
7547
|
|
|
7570
7548
|
// src/extra/reactive-index.ts
|
|
7571
|
-
function emptySnapshot2() {
|
|
7572
|
-
return { version: 0, value: { rows: [] } };
|
|
7573
|
-
}
|
|
7574
7549
|
function rowKey(row) {
|
|
7575
7550
|
return [row.secondary, row.primary];
|
|
7576
7551
|
}
|
|
@@ -7616,31 +7591,25 @@ function keepaliveDerived(n) {
|
|
|
7616
7591
|
function reactiveIndex(options = {}) {
|
|
7617
7592
|
const { name } = options;
|
|
7618
7593
|
const buf = [];
|
|
7619
|
-
|
|
7620
|
-
const ordered = state(current, {
|
|
7594
|
+
const ordered = state([], {
|
|
7621
7595
|
name,
|
|
7622
7596
|
describeKind: "state",
|
|
7623
|
-
equals:
|
|
7597
|
+
equals: (a, b) => a === b
|
|
7624
7598
|
});
|
|
7625
7599
|
const byPrimary = derived(
|
|
7626
7600
|
[ordered],
|
|
7627
7601
|
([s]) => {
|
|
7628
|
-
const rows = s
|
|
7602
|
+
const rows = s;
|
|
7629
7603
|
return byPrimaryMap(rows);
|
|
7630
7604
|
},
|
|
7631
7605
|
{ initial: /* @__PURE__ */ new Map(), describeKind: "derived" }
|
|
7632
7606
|
);
|
|
7633
7607
|
keepaliveDerived(byPrimary);
|
|
7634
7608
|
function pushSnapshot() {
|
|
7635
|
-
const
|
|
7636
|
-
current = bumpVersion(
|
|
7637
|
-
current,
|
|
7638
|
-
{ rows: [...buf] },
|
|
7639
|
-
ov ? { id: ov.id, version: ov.version } : void 0
|
|
7640
|
-
);
|
|
7609
|
+
const snapshot = [...buf];
|
|
7641
7610
|
batch(() => {
|
|
7642
7611
|
ordered.down([[DIRTY]]);
|
|
7643
|
-
ordered.down([[DATA,
|
|
7612
|
+
ordered.down([[DATA, snapshot]]);
|
|
7644
7613
|
});
|
|
7645
7614
|
}
|
|
7646
7615
|
return {
|
|
@@ -7671,28 +7640,19 @@ function reactiveIndex(options = {}) {
|
|
|
7671
7640
|
}
|
|
7672
7641
|
|
|
7673
7642
|
// src/extra/reactive-list.ts
|
|
7674
|
-
function emptySnapshot3() {
|
|
7675
|
-
return { version: 0, value: { items: [] } };
|
|
7676
|
-
}
|
|
7677
7643
|
function reactiveList(initial, options = {}) {
|
|
7678
7644
|
const { name } = options;
|
|
7679
7645
|
const buf = initial ? [...initial] : [];
|
|
7680
|
-
|
|
7681
|
-
const items = state(current, {
|
|
7646
|
+
const items = state(buf.length > 0 ? [...buf] : [], {
|
|
7682
7647
|
name,
|
|
7683
7648
|
describeKind: "state",
|
|
7684
|
-
equals:
|
|
7649
|
+
equals: (a, b) => a === b
|
|
7685
7650
|
});
|
|
7686
7651
|
function pushSnapshot() {
|
|
7687
|
-
const
|
|
7688
|
-
current = bumpVersion(
|
|
7689
|
-
current,
|
|
7690
|
-
{ items: [...buf] },
|
|
7691
|
-
iv ? { id: iv.id, version: iv.version } : void 0
|
|
7692
|
-
);
|
|
7652
|
+
const snapshot = [...buf];
|
|
7693
7653
|
batch(() => {
|
|
7694
7654
|
items.down([[DIRTY]]);
|
|
7695
|
-
items.down([[DATA,
|
|
7655
|
+
items.down([[DATA, snapshot]]);
|
|
7696
7656
|
});
|
|
7697
7657
|
}
|
|
7698
7658
|
return {
|
|
@@ -7729,9 +7689,6 @@ function reactiveList(initial, options = {}) {
|
|
|
7729
7689
|
}
|
|
7730
7690
|
|
|
7731
7691
|
// src/extra/reactive-log.ts
|
|
7732
|
-
function emptySnapshot4() {
|
|
7733
|
-
return { version: 0, value: { entries: [] } };
|
|
7734
|
-
}
|
|
7735
7692
|
function keepaliveDerived2(n) {
|
|
7736
7693
|
return n.subscribe(() => {
|
|
7737
7694
|
});
|
|
@@ -7745,22 +7702,16 @@ function reactiveLog(initial, options = {}) {
|
|
|
7745
7702
|
if (maxSize !== void 0 && buf.length > maxSize) {
|
|
7746
7703
|
buf.splice(0, buf.length - maxSize);
|
|
7747
7704
|
}
|
|
7748
|
-
|
|
7749
|
-
const entries = state(current, {
|
|
7705
|
+
const entries = state(buf.length > 0 ? [...buf] : [], {
|
|
7750
7706
|
name,
|
|
7751
7707
|
describeKind: "state",
|
|
7752
|
-
equals:
|
|
7708
|
+
equals: (a, b) => a === b
|
|
7753
7709
|
});
|
|
7754
7710
|
function pushSnapshot() {
|
|
7755
|
-
const
|
|
7756
|
-
current = bumpVersion(
|
|
7757
|
-
current,
|
|
7758
|
-
{ entries: [...buf] },
|
|
7759
|
-
ev ? { id: ev.id, version: ev.version } : void 0
|
|
7760
|
-
);
|
|
7711
|
+
const snapshot = [...buf];
|
|
7761
7712
|
batch(() => {
|
|
7762
7713
|
entries.down([[DIRTY]]);
|
|
7763
|
-
entries.down([[DATA,
|
|
7714
|
+
entries.down([[DATA, snapshot]]);
|
|
7764
7715
|
});
|
|
7765
7716
|
}
|
|
7766
7717
|
function trimBuf() {
|
|
@@ -7803,13 +7754,12 @@ function reactiveLog(initial, options = {}) {
|
|
|
7803
7754
|
if (n < 0) {
|
|
7804
7755
|
throw new RangeError("n must be >= 0");
|
|
7805
7756
|
}
|
|
7806
|
-
const
|
|
7807
|
-
const e = snap.value.entries;
|
|
7757
|
+
const e = entries.get();
|
|
7808
7758
|
const init = n === 0 ? [] : e.slice(Math.max(0, e.length - n));
|
|
7809
7759
|
const out = derived(
|
|
7810
7760
|
[entries],
|
|
7811
7761
|
([s]) => {
|
|
7812
|
-
const list = s
|
|
7762
|
+
const list = s;
|
|
7813
7763
|
return n === 0 ? [] : list.slice(Math.max(0, list.length - n));
|
|
7814
7764
|
},
|
|
7815
7765
|
{ initial: init, describeKind: "derived" }
|
|
@@ -7824,13 +7774,12 @@ function logSlice(log, start, stop) {
|
|
|
7824
7774
|
if (start < 0) {
|
|
7825
7775
|
throw new RangeError("start must be >= 0");
|
|
7826
7776
|
}
|
|
7827
|
-
const
|
|
7828
|
-
const e = snap.value.entries;
|
|
7777
|
+
const e = log.entries.get();
|
|
7829
7778
|
const init = stop === void 0 ? e.slice(start) : e.slice(start, stop);
|
|
7830
7779
|
const out = derived(
|
|
7831
7780
|
[log.entries],
|
|
7832
7781
|
([s]) => {
|
|
7833
|
-
const list = s
|
|
7782
|
+
const list = s;
|
|
7834
7783
|
return stop === void 0 ? list.slice(start) : list.slice(start, stop);
|
|
7835
7784
|
},
|
|
7836
7785
|
{ initial: init, describeKind: "derived" }
|