@vertz/ui 0.2.24 → 0.2.26
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/shared/{chunk-2eh4p2n7.js → chunk-09ntccdx.js} +1 -1
- package/dist/shared/{chunk-4gen306a.js → chunk-1jgws7rs.js} +4 -109
- package/dist/shared/{chunk-2wag9c7v.js → chunk-2krx4aqe.js} +5 -5
- package/dist/shared/{chunk-f4d5nphq.js → chunk-7nr2ebrf.js} +1 -1
- package/dist/shared/{chunk-mbnda3pv.js → chunk-djvarb8r.js} +123 -76
- package/dist/shared/{chunk-jtma4sh4.js → chunk-e09mdqcx.js} +2 -2
- package/dist/shared/{chunk-4gmtsf6v.js → chunk-h2sjma78.js} +110 -1
- package/dist/shared/{chunk-t3rnfxc0.js → chunk-j1a7t906.js} +2 -2
- package/dist/shared/{chunk-656n0x6y.js → chunk-ppr06jgn.js} +8 -2
- package/dist/shared/{chunk-ge2e6y2s.js → chunk-svvqjmyy.js} +1 -1
- package/dist/shared/{chunk-da2w7j7w.js → chunk-xs5s8gqe.js} +1 -1
- package/dist/shared/{chunk-18frwfc4.js → chunk-ymc3wwam.js} +8 -2
- package/dist/src/auth/public.js +4 -4
- package/dist/src/components/index.d.ts +2 -1
- package/dist/src/components/index.js +5 -0
- package/dist/src/css/public.js +3 -4
- package/dist/src/form/public.d.ts +11 -0
- package/dist/src/form/public.js +2 -2
- package/dist/src/index.d.ts +37 -44
- package/dist/src/index.js +17 -202
- package/dist/src/internals.d.ts +51 -5
- package/dist/src/internals.js +284 -74
- package/dist/src/query/public.d.ts +1 -32
- package/dist/src/query/public.js +5 -8
- package/dist/src/router/public.js +7 -8
- package/dist/src/test/index.js +3 -3
- package/package.json +3 -3
- package/dist/shared/chunk-2y9f9j62.js +0 -40
package/dist/src/internals.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
|
+
ListAnimationContext,
|
|
2
3
|
deserializeProps,
|
|
3
4
|
onAnimationsComplete,
|
|
4
5
|
resolveComponent
|
|
5
|
-
} from "../shared/chunk-
|
|
6
|
+
} from "../shared/chunk-ymc3wwam.js";
|
|
6
7
|
import {
|
|
7
8
|
__discardMountFrame,
|
|
8
9
|
__flushMountFrame,
|
|
9
10
|
__on,
|
|
10
11
|
__pushMountFrame
|
|
11
|
-
} from "../shared/chunk-
|
|
12
|
+
} from "../shared/chunk-svvqjmyy.js";
|
|
12
13
|
import {
|
|
13
14
|
executeLoaders,
|
|
14
15
|
matchPath,
|
|
@@ -19,7 +20,7 @@ import {
|
|
|
19
20
|
MemoryCache,
|
|
20
21
|
QueryEnvelopeStore,
|
|
21
22
|
deriveKey
|
|
22
|
-
} from "../shared/chunk-
|
|
23
|
+
} from "../shared/chunk-1jgws7rs.js";
|
|
23
24
|
import"../shared/chunk-jrtrk5z4.js";
|
|
24
25
|
import {
|
|
25
26
|
ALIGNMENT_MAP,
|
|
@@ -40,8 +41,9 @@ import {
|
|
|
40
41
|
SIZE_KEYWORDS,
|
|
41
42
|
SPACING_SCALE,
|
|
42
43
|
compileTheme
|
|
43
|
-
} from "../shared/chunk-
|
|
44
|
+
} from "../shared/chunk-j1a7t906.js";
|
|
44
45
|
import {
|
|
46
|
+
RENDER_NODE_BRAND,
|
|
45
47
|
__append,
|
|
46
48
|
__attr,
|
|
47
49
|
__child,
|
|
@@ -53,24 +55,21 @@ import {
|
|
|
53
55
|
__prop,
|
|
54
56
|
__show,
|
|
55
57
|
__staticText,
|
|
56
|
-
__text
|
|
57
|
-
|
|
58
|
+
__text,
|
|
59
|
+
createDOMAdapter,
|
|
60
|
+
getAdapter,
|
|
61
|
+
isRenderNode,
|
|
62
|
+
setAdapter
|
|
63
|
+
} from "../shared/chunk-djvarb8r.js";
|
|
58
64
|
import {
|
|
59
65
|
SVG_NS,
|
|
60
66
|
normalizeSVGAttr,
|
|
61
67
|
styleObjectToString
|
|
62
68
|
} from "../shared/chunk-h1fsr8kv.js";
|
|
63
|
-
import
|
|
64
|
-
RENDER_NODE_BRAND,
|
|
65
|
-
createDOMAdapter,
|
|
66
|
-
getAdapter,
|
|
67
|
-
isRenderNode,
|
|
68
|
-
setAdapter
|
|
69
|
-
} from "../shared/chunk-2y9f9j62.js";
|
|
70
|
-
import"../shared/chunk-2eh4p2n7.js";
|
|
69
|
+
import"../shared/chunk-09ntccdx.js";
|
|
71
70
|
import {
|
|
72
71
|
isBrowser
|
|
73
|
-
} from "../shared/chunk-
|
|
72
|
+
} from "../shared/chunk-xs5s8gqe.js";
|
|
74
73
|
import {
|
|
75
74
|
_tryOnCleanup,
|
|
76
75
|
claimComment,
|
|
@@ -89,23 +88,39 @@ import {
|
|
|
89
88
|
setContextScope,
|
|
90
89
|
signal,
|
|
91
90
|
startSignalCollection,
|
|
92
|
-
stopSignalCollection
|
|
93
|
-
|
|
91
|
+
stopSignalCollection,
|
|
92
|
+
useContext
|
|
93
|
+
} from "../shared/chunk-ppr06jgn.js";
|
|
94
94
|
// src/dom/conditional.ts
|
|
95
|
-
function
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
function clearBetween(start, end) {
|
|
96
|
+
let current = start.nextSibling;
|
|
97
|
+
while (current && current !== end) {
|
|
98
|
+
const next = current.nextSibling;
|
|
99
|
+
current.parentNode?.removeChild(current);
|
|
100
|
+
current = next;
|
|
98
101
|
}
|
|
102
|
+
}
|
|
103
|
+
function insertContentBefore(endMarker, branchResult) {
|
|
104
|
+
if (branchResult == null || typeof branchResult === "boolean")
|
|
105
|
+
return;
|
|
106
|
+
const parent = endMarker.parentNode;
|
|
107
|
+
if (!parent)
|
|
108
|
+
return;
|
|
99
109
|
if (isRenderNode(branchResult)) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
110
|
+
parent.insertBefore(branchResult, endMarker);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const text = getAdapter().createTextNode(String(branchResult));
|
|
114
|
+
parent.insertBefore(text, endMarker);
|
|
115
|
+
}
|
|
116
|
+
function appendBranchContent(fragment, branchResult) {
|
|
117
|
+
if (branchResult == null || typeof branchResult === "boolean")
|
|
118
|
+
return;
|
|
119
|
+
if (isRenderNode(branchResult)) {
|
|
120
|
+
fragment.appendChild(branchResult);
|
|
121
|
+
return;
|
|
107
122
|
}
|
|
108
|
-
|
|
123
|
+
fragment.appendChild(getAdapter().createTextNode(String(branchResult)));
|
|
109
124
|
}
|
|
110
125
|
function __conditional(condFn, trueFn, falseFn) {
|
|
111
126
|
if (getIsHydrating()) {
|
|
@@ -119,11 +134,11 @@ function hydrateConditional(condFn, trueFn, falseFn) {
|
|
|
119
134
|
return csrConditional(condFn, trueFn, falseFn);
|
|
120
135
|
}
|
|
121
136
|
const anchor = claimed;
|
|
122
|
-
let currentNode = null;
|
|
123
137
|
let branchCleanups = [];
|
|
124
|
-
let
|
|
125
|
-
const outerScope = pushScope();
|
|
138
|
+
let endMarker = null;
|
|
126
139
|
let isFirstRun = true;
|
|
140
|
+
let needsCsrFallback = false;
|
|
141
|
+
const outerScope = pushScope();
|
|
127
142
|
domEffect(() => {
|
|
128
143
|
const show = condFn();
|
|
129
144
|
if (isFirstRun) {
|
|
@@ -132,60 +147,47 @@ function hydrateConditional(condFn, trueFn, falseFn) {
|
|
|
132
147
|
const branchResult2 = show ? trueFn() : falseFn();
|
|
133
148
|
popScope();
|
|
134
149
|
branchCleanups = scope2;
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
contentNode = null;
|
|
138
|
-
} else if (isRenderNode(branchResult2)) {
|
|
139
|
-
contentNode = branchResult2;
|
|
140
|
-
} else {
|
|
141
|
-
const claimed2 = claimText();
|
|
142
|
-
contentNode = claimed2 ?? getAdapter().createTextNode(String(branchResult2));
|
|
150
|
+
if (branchResult2 != null && !isRenderNode(branchResult2) && typeof branchResult2 !== "boolean") {
|
|
151
|
+
claimText();
|
|
143
152
|
}
|
|
144
|
-
const
|
|
145
|
-
if (
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
anchorParent.insertBefore(wrap, anchor);
|
|
149
|
-
wrap.appendChild(anchor);
|
|
150
|
-
if (contentNode?.parentNode && contentNode.parentNode !== wrap) {
|
|
151
|
-
wrap.appendChild(contentNode);
|
|
152
|
-
}
|
|
153
|
-
currentNode = wrap;
|
|
154
|
-
resultNode = wrap;
|
|
155
|
-
} else {
|
|
156
|
-
currentNode = contentNode ?? getAdapter().createComment("empty");
|
|
157
|
-
resultNode = currentNode;
|
|
153
|
+
const claimedEnd = claimComment();
|
|
154
|
+
if (!claimedEnd) {
|
|
155
|
+
needsCsrFallback = true;
|
|
156
|
+
return;
|
|
158
157
|
}
|
|
158
|
+
endMarker = claimedEnd;
|
|
159
159
|
return;
|
|
160
160
|
}
|
|
161
161
|
runCleanups(branchCleanups);
|
|
162
|
+
clearBetween(anchor, endMarker);
|
|
162
163
|
const scope = pushScope();
|
|
163
164
|
const branchResult = show ? trueFn() : falseFn();
|
|
164
165
|
popScope();
|
|
165
166
|
branchCleanups = scope;
|
|
166
|
-
|
|
167
|
-
if (currentNode?.parentNode) {
|
|
168
|
-
currentNode.parentNode.replaceChild(newNode, currentNode);
|
|
169
|
-
} else if (anchor.parentNode) {
|
|
170
|
-
anchor.parentNode.insertBefore(newNode, anchor.nextSibling);
|
|
171
|
-
}
|
|
172
|
-
currentNode = newNode;
|
|
167
|
+
insertContentBefore(endMarker, branchResult);
|
|
173
168
|
});
|
|
174
169
|
popScope();
|
|
170
|
+
if (needsCsrFallback) {
|
|
171
|
+
runCleanups(branchCleanups);
|
|
172
|
+
runCleanups(outerScope);
|
|
173
|
+
return csrConditional(condFn, trueFn, falseFn);
|
|
174
|
+
}
|
|
175
175
|
const disposeFn = () => {
|
|
176
176
|
runCleanups(branchCleanups);
|
|
177
177
|
runCleanups(outerScope);
|
|
178
178
|
};
|
|
179
179
|
_tryOnCleanup(disposeFn);
|
|
180
|
-
const result = Object.assign(
|
|
180
|
+
const result = Object.assign(anchor, {
|
|
181
181
|
dispose: disposeFn
|
|
182
182
|
});
|
|
183
183
|
return result;
|
|
184
184
|
}
|
|
185
185
|
function csrConditional(condFn, trueFn, falseFn) {
|
|
186
186
|
const anchor = getAdapter().createComment("conditional");
|
|
187
|
-
|
|
187
|
+
const endMarker = getAdapter().createComment("/conditional");
|
|
188
188
|
let branchCleanups = [];
|
|
189
|
+
let isFirstRun = true;
|
|
190
|
+
let firstRunResult;
|
|
189
191
|
const outerScope = pushScope();
|
|
190
192
|
domEffect(() => {
|
|
191
193
|
const show = condFn();
|
|
@@ -194,26 +196,26 @@ function csrConditional(condFn, trueFn, falseFn) {
|
|
|
194
196
|
const branchResult = show ? trueFn() : falseFn();
|
|
195
197
|
popScope();
|
|
196
198
|
branchCleanups = scope;
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
anchor.parentNode.insertBefore(newNode, anchor.nextSibling);
|
|
199
|
+
if (isFirstRun) {
|
|
200
|
+
isFirstRun = false;
|
|
201
|
+
firstRunResult = branchResult;
|
|
202
|
+
return;
|
|
202
203
|
}
|
|
203
|
-
|
|
204
|
+
clearBetween(anchor, endMarker);
|
|
205
|
+
insertContentBefore(endMarker, branchResult);
|
|
204
206
|
});
|
|
205
207
|
popScope();
|
|
206
|
-
const
|
|
208
|
+
const disposeFn = () => {
|
|
207
209
|
runCleanups(branchCleanups);
|
|
208
210
|
runCleanups(outerScope);
|
|
209
211
|
};
|
|
210
|
-
_tryOnCleanup(
|
|
212
|
+
_tryOnCleanup(disposeFn);
|
|
211
213
|
const fragment = getAdapter().createDocumentFragment();
|
|
212
214
|
fragment.appendChild(anchor);
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
const result = Object.assign(fragment, { dispose:
|
|
215
|
+
appendBranchContent(fragment, firstRunResult);
|
|
216
|
+
firstRunResult = undefined;
|
|
217
|
+
fragment.appendChild(endMarker);
|
|
218
|
+
const result = Object.assign(fragment, { dispose: disposeFn });
|
|
217
219
|
return result;
|
|
218
220
|
}
|
|
219
221
|
// src/dom/insert.ts
|
|
@@ -395,6 +397,212 @@ function fixUpSelectValue(container) {
|
|
|
395
397
|
}
|
|
396
398
|
}
|
|
397
399
|
}
|
|
400
|
+
// src/dom/list-value.ts
|
|
401
|
+
var unkeyedListValueWarned = false;
|
|
402
|
+
function createItemProxy2(itemSignal) {
|
|
403
|
+
const initial = itemSignal.peek();
|
|
404
|
+
if (typeof initial !== "object" || initial == null) {
|
|
405
|
+
return initial;
|
|
406
|
+
}
|
|
407
|
+
return new Proxy(initial, {
|
|
408
|
+
get(_target, prop, receiver) {
|
|
409
|
+
const current = itemSignal.value;
|
|
410
|
+
if (current == null)
|
|
411
|
+
return;
|
|
412
|
+
const value = Reflect.get(current, prop, receiver);
|
|
413
|
+
if (typeof value === "function") {
|
|
414
|
+
return value.bind(current);
|
|
415
|
+
}
|
|
416
|
+
return value;
|
|
417
|
+
},
|
|
418
|
+
set() {
|
|
419
|
+
return false;
|
|
420
|
+
},
|
|
421
|
+
has(_target, prop) {
|
|
422
|
+
const current = itemSignal.value;
|
|
423
|
+
if (current == null)
|
|
424
|
+
return false;
|
|
425
|
+
return Reflect.has(current, prop);
|
|
426
|
+
},
|
|
427
|
+
ownKeys() {
|
|
428
|
+
const current = itemSignal.value;
|
|
429
|
+
if (current == null)
|
|
430
|
+
return [];
|
|
431
|
+
return Reflect.ownKeys(current);
|
|
432
|
+
},
|
|
433
|
+
getOwnPropertyDescriptor(_target, prop) {
|
|
434
|
+
const current = itemSignal.value;
|
|
435
|
+
if (current == null)
|
|
436
|
+
return;
|
|
437
|
+
return Reflect.getOwnPropertyDescriptor(current, prop);
|
|
438
|
+
},
|
|
439
|
+
getPrototypeOf() {
|
|
440
|
+
const current = itemSignal.value;
|
|
441
|
+
if (current == null)
|
|
442
|
+
return null;
|
|
443
|
+
return Object.getPrototypeOf(current);
|
|
444
|
+
}
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
function __listValue(items, keyFn, renderFn) {
|
|
448
|
+
const getItems = typeof items === "function" ? items : () => items.value;
|
|
449
|
+
const startMarker = document.createComment("lv-s");
|
|
450
|
+
const endMarker = document.createComment("lv-e");
|
|
451
|
+
const fragment = document.createDocumentFragment();
|
|
452
|
+
fragment.appendChild(startMarker);
|
|
453
|
+
fragment.appendChild(endMarker);
|
|
454
|
+
const nodeMap = new Map;
|
|
455
|
+
const scopeMap = new Map;
|
|
456
|
+
const itemSignalMap = new Map;
|
|
457
|
+
const exitingNodes = new Set;
|
|
458
|
+
const exitingKeyMap = new Map;
|
|
459
|
+
const keyGeneration = new Map;
|
|
460
|
+
const animHooks = useContext(ListAnimationContext);
|
|
461
|
+
let isFirstRun = true;
|
|
462
|
+
if (!keyFn && !unkeyedListValueWarned) {
|
|
463
|
+
unkeyedListValueWarned = true;
|
|
464
|
+
console.warn("[vertz] .map() without a key prop uses full-replacement mode (slower). " + "Add a key prop to list items for efficient updates: " + "{items.map(item => <Item key={item.id} />)}");
|
|
465
|
+
}
|
|
466
|
+
const outerScope = pushScope();
|
|
467
|
+
try {
|
|
468
|
+
domEffect(() => {
|
|
469
|
+
const newItems = getItems() ?? [];
|
|
470
|
+
if (!keyFn) {
|
|
471
|
+
for (const scope of scopeMap.values()) {
|
|
472
|
+
runCleanups(scope);
|
|
473
|
+
}
|
|
474
|
+
scopeMap.clear();
|
|
475
|
+
for (const node of nodeMap.values()) {
|
|
476
|
+
node.parentNode?.removeChild(node);
|
|
477
|
+
}
|
|
478
|
+
nodeMap.clear();
|
|
479
|
+
itemSignalMap.clear();
|
|
480
|
+
for (const [i, item] of newItems.entries()) {
|
|
481
|
+
const scope = pushScope();
|
|
482
|
+
const node = renderFn(item);
|
|
483
|
+
popScope();
|
|
484
|
+
endMarker.parentNode?.insertBefore(node, endMarker);
|
|
485
|
+
nodeMap.set(i, node);
|
|
486
|
+
scopeMap.set(i, scope);
|
|
487
|
+
}
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
if (isFirstRun) {
|
|
491
|
+
isFirstRun = false;
|
|
492
|
+
for (const [i, item] of newItems.entries()) {
|
|
493
|
+
const key = keyFn(item, i);
|
|
494
|
+
const itemSig = signal(item);
|
|
495
|
+
const proxy = createItemProxy2(itemSig);
|
|
496
|
+
const scope = pushScope();
|
|
497
|
+
const node = renderFn(proxy);
|
|
498
|
+
popScope();
|
|
499
|
+
nodeMap.set(key, node);
|
|
500
|
+
scopeMap.set(key, scope);
|
|
501
|
+
itemSignalMap.set(key, itemSig);
|
|
502
|
+
endMarker.parentNode?.insertBefore(node, endMarker);
|
|
503
|
+
}
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
506
|
+
animHooks?.onBeforeReconcile();
|
|
507
|
+
const newKeySet = new Set(newItems.map((item, i) => keyFn(item, i)));
|
|
508
|
+
for (const [key, node] of nodeMap) {
|
|
509
|
+
if (!newKeySet.has(key)) {
|
|
510
|
+
const scope = scopeMap.get(key);
|
|
511
|
+
if (scope) {
|
|
512
|
+
runCleanups(scope);
|
|
513
|
+
scopeMap.delete(key);
|
|
514
|
+
}
|
|
515
|
+
nodeMap.delete(key);
|
|
516
|
+
itemSignalMap.delete(key);
|
|
517
|
+
if (animHooks) {
|
|
518
|
+
const gen = (keyGeneration.get(key) ?? 0) + 1;
|
|
519
|
+
keyGeneration.set(key, gen);
|
|
520
|
+
exitingNodes.add(node);
|
|
521
|
+
exitingKeyMap.set(key, node);
|
|
522
|
+
animHooks.onItemExit(node, key, () => {
|
|
523
|
+
if (keyGeneration.get(key) === gen) {
|
|
524
|
+
node.parentNode?.removeChild(node);
|
|
525
|
+
exitingNodes.delete(node);
|
|
526
|
+
exitingKeyMap.delete(key);
|
|
527
|
+
}
|
|
528
|
+
});
|
|
529
|
+
} else {
|
|
530
|
+
node.parentNode?.removeChild(node);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
const desiredNodes = [];
|
|
535
|
+
const enterEntries = [];
|
|
536
|
+
for (const [i, item] of newItems.entries()) {
|
|
537
|
+
const key = keyFn(item, i);
|
|
538
|
+
let node = nodeMap.get(key);
|
|
539
|
+
if (!node) {
|
|
540
|
+
const oldExiting = exitingKeyMap.get(key);
|
|
541
|
+
if (oldExiting) {
|
|
542
|
+
oldExiting.parentNode?.removeChild(oldExiting);
|
|
543
|
+
exitingNodes.delete(oldExiting);
|
|
544
|
+
exitingKeyMap.delete(key);
|
|
545
|
+
}
|
|
546
|
+
const gen = (keyGeneration.get(key) ?? 0) + 1;
|
|
547
|
+
keyGeneration.set(key, gen);
|
|
548
|
+
const itemSig = signal(item);
|
|
549
|
+
const proxy = createItemProxy2(itemSig);
|
|
550
|
+
const scope = pushScope();
|
|
551
|
+
node = renderFn(proxy);
|
|
552
|
+
popScope();
|
|
553
|
+
nodeMap.set(key, node);
|
|
554
|
+
scopeMap.set(key, scope);
|
|
555
|
+
itemSignalMap.set(key, itemSig);
|
|
556
|
+
enterEntries.push({ node, key });
|
|
557
|
+
} else {
|
|
558
|
+
const itemSig = itemSignalMap.get(key);
|
|
559
|
+
if (itemSig) {
|
|
560
|
+
itemSig.value = item;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
desiredNodes.push(node);
|
|
564
|
+
}
|
|
565
|
+
const parent = startMarker.parentNode;
|
|
566
|
+
if (parent) {
|
|
567
|
+
let cursor = startMarker.nextSibling;
|
|
568
|
+
for (const desired of desiredNodes) {
|
|
569
|
+
while (cursor && cursor !== endMarker && exitingNodes.has(cursor)) {
|
|
570
|
+
cursor = cursor.nextSibling;
|
|
571
|
+
}
|
|
572
|
+
if (cursor === endMarker) {
|
|
573
|
+
parent.insertBefore(desired, endMarker);
|
|
574
|
+
} else if (cursor === desired) {
|
|
575
|
+
cursor = cursor.nextSibling;
|
|
576
|
+
} else {
|
|
577
|
+
parent.insertBefore(desired, cursor);
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
if (animHooks) {
|
|
582
|
+
for (const { node, key } of enterEntries) {
|
|
583
|
+
animHooks.onItemEnter(node, key);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
animHooks?.onAfterReconcile();
|
|
587
|
+
});
|
|
588
|
+
} finally {
|
|
589
|
+
popScope();
|
|
590
|
+
}
|
|
591
|
+
const dispose = () => {
|
|
592
|
+
for (const scope of scopeMap.values()) {
|
|
593
|
+
runCleanups(scope);
|
|
594
|
+
}
|
|
595
|
+
scopeMap.clear();
|
|
596
|
+
for (const node of exitingNodes) {
|
|
597
|
+
node.parentNode?.removeChild(node);
|
|
598
|
+
}
|
|
599
|
+
exitingNodes.clear();
|
|
600
|
+
exitingKeyMap.clear();
|
|
601
|
+
runCleanups(outerScope);
|
|
602
|
+
};
|
|
603
|
+
_tryOnCleanup(dispose);
|
|
604
|
+
return Object.assign(fragment, { dispose });
|
|
605
|
+
}
|
|
398
606
|
// src/dom/spread.ts
|
|
399
607
|
var SKIP_KEYS = new Set(["children", "key"]);
|
|
400
608
|
var PROP_ALIASES = {
|
|
@@ -476,6 +684,7 @@ export {
|
|
|
476
684
|
__pushMountFrame,
|
|
477
685
|
__prop,
|
|
478
686
|
__on,
|
|
687
|
+
__listValue,
|
|
479
688
|
__list,
|
|
480
689
|
__insert,
|
|
481
690
|
__flushMountFrame,
|
|
@@ -498,6 +707,7 @@ export {
|
|
|
498
707
|
PSEUDO_MAP,
|
|
499
708
|
PROPERTY_MAP,
|
|
500
709
|
MemoryCache,
|
|
710
|
+
ListAnimationContext,
|
|
501
711
|
LINE_HEIGHT_SCALE,
|
|
502
712
|
KEYWORD_MAP,
|
|
503
713
|
HEIGHT_AXIS_PROPERTIES,
|
|
@@ -29,8 +29,6 @@ interface ReadonlySignal<T> {
|
|
|
29
29
|
* type UnwrappedData = Unwrapped<ReadonlySignal<Task | undefined>>; // → Task | undefined
|
|
30
30
|
*/
|
|
31
31
|
type Unwrapped<T> = T extends ReadonlySignal<infer U> ? U : T;
|
|
32
|
-
/** Dispose function returned by effect(). */
|
|
33
|
-
type DisposeFn = () => void;
|
|
34
32
|
/** Options for query(). */
|
|
35
33
|
interface QueryOptions<T> {
|
|
36
34
|
/** Pre-populated data — skips the initial fetch when provided. */
|
|
@@ -98,33 +96,4 @@ declare function query<
|
|
|
98
96
|
E
|
|
99
97
|
>(thunk: () => QueryDescriptor<T, E> | null, options?: Omit<QueryOptions<T>, "key">): QueryResult<T, E>;
|
|
100
98
|
declare function query<T>(thunk: () => Promise<T> | null, options?: QueryOptions<T>): QueryResult<T>;
|
|
101
|
-
|
|
102
|
-
T,
|
|
103
|
-
E
|
|
104
|
-
> {
|
|
105
|
-
loading: () => Node | null;
|
|
106
|
-
error: (error: E) => Node | null;
|
|
107
|
-
data: (data: T) => Node | null;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Pattern-match on a QueryResult's exclusive state.
|
|
111
|
-
*
|
|
112
|
-
* Returns a stable `<span style="display:contents">` wrapper that internally
|
|
113
|
-
* manages branch switching (loading/error/data) via a reactive effect.
|
|
114
|
-
* The same wrapper is returned for repeated calls with the same queryResult
|
|
115
|
-
* (cached via WeakMap), enabling __child's stable-node optimization.
|
|
116
|
-
*
|
|
117
|
-
* Priority: loading → error → data.
|
|
118
|
-
*
|
|
119
|
-
* `loading` only fires on the initial load (no data yet).
|
|
120
|
-
* When revalidating with existing data, the `data` handler receives the
|
|
121
|
-
* current data. Access `query.revalidating` from the component scope for
|
|
122
|
-
* revalidation state.
|
|
123
|
-
*/
|
|
124
|
-
declare function queryMatch<
|
|
125
|
-
T,
|
|
126
|
-
E
|
|
127
|
-
>(queryResult: QueryResult<T, E>, handlers: QueryMatchHandlers<T, E>): HTMLElement & {
|
|
128
|
-
dispose: DisposeFn;
|
|
129
|
-
};
|
|
130
|
-
export { queryMatch, query, isQueryDescriptor, QueryResult, QueryOptions, QueryMatchHandlers, QueryDescriptor2 as QueryDescriptor, CacheStore };
|
|
99
|
+
export { query, isQueryDescriptor, QueryResult, QueryOptions, QueryDescriptor2 as QueryDescriptor, CacheStore };
|
package/dist/src/query/public.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
|
-
query
|
|
3
|
-
|
|
4
|
-
} from "../../shared/chunk-4gen306a.js";
|
|
2
|
+
query
|
|
3
|
+
} from "../../shared/chunk-1jgws7rs.js";
|
|
5
4
|
import"../../shared/chunk-jrtrk5z4.js";
|
|
6
|
-
import"../../shared/chunk-
|
|
7
|
-
import"../../shared/chunk-
|
|
8
|
-
import"../../shared/chunk-
|
|
9
|
-
import"../../shared/chunk-656n0x6y.js";
|
|
5
|
+
import"../../shared/chunk-09ntccdx.js";
|
|
6
|
+
import"../../shared/chunk-xs5s8gqe.js";
|
|
7
|
+
import"../../shared/chunk-ppr06jgn.js";
|
|
10
8
|
|
|
11
9
|
// src/query/public.ts
|
|
12
10
|
import { isQueryDescriptor } from "@vertz/fetch";
|
|
13
11
|
export {
|
|
14
|
-
queryMatch,
|
|
15
12
|
query,
|
|
16
13
|
isQueryDescriptor
|
|
17
14
|
};
|
|
@@ -6,25 +6,24 @@ import {
|
|
|
6
6
|
createLink,
|
|
7
7
|
parseSearchParams,
|
|
8
8
|
useSearchParams
|
|
9
|
-
} from "../../shared/chunk-
|
|
10
|
-
import"../../shared/chunk-
|
|
9
|
+
} from "../../shared/chunk-2krx4aqe.js";
|
|
10
|
+
import"../../shared/chunk-svvqjmyy.js";
|
|
11
11
|
import {
|
|
12
12
|
createRouter
|
|
13
|
-
} from "../../shared/chunk-
|
|
13
|
+
} from "../../shared/chunk-e09mdqcx.js";
|
|
14
14
|
import {
|
|
15
15
|
defineRoutes
|
|
16
16
|
} from "../../shared/chunk-am9zaw4h.js";
|
|
17
17
|
import"../../shared/chunk-jrtrk5z4.js";
|
|
18
|
-
import"../../shared/chunk-
|
|
18
|
+
import"../../shared/chunk-djvarb8r.js";
|
|
19
19
|
import"../../shared/chunk-h1fsr8kv.js";
|
|
20
|
-
import"../../shared/chunk-2y9f9j62.js";
|
|
21
20
|
import {
|
|
22
21
|
RouterContext,
|
|
23
22
|
useParams,
|
|
24
23
|
useRouter
|
|
25
|
-
} from "../../shared/chunk-
|
|
26
|
-
import"../../shared/chunk-
|
|
27
|
-
import"../../shared/chunk-
|
|
24
|
+
} from "../../shared/chunk-7nr2ebrf.js";
|
|
25
|
+
import"../../shared/chunk-xs5s8gqe.js";
|
|
26
|
+
import"../../shared/chunk-ppr06jgn.js";
|
|
28
27
|
export {
|
|
29
28
|
useSearchParams,
|
|
30
29
|
useRouter,
|
package/dist/src/test/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRouter
|
|
3
|
-
} from "../../shared/chunk-
|
|
3
|
+
} from "../../shared/chunk-e09mdqcx.js";
|
|
4
4
|
import {
|
|
5
5
|
defineRoutes
|
|
6
6
|
} from "../../shared/chunk-am9zaw4h.js";
|
|
7
7
|
import"../../shared/chunk-jrtrk5z4.js";
|
|
8
|
-
import"../../shared/chunk-
|
|
9
|
-
import"../../shared/chunk-
|
|
8
|
+
import"../../shared/chunk-xs5s8gqe.js";
|
|
9
|
+
import"../../shared/chunk-ppr06jgn.js";
|
|
10
10
|
|
|
11
11
|
// src/test/interactions.ts
|
|
12
12
|
async function click(el) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertz/ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.26",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Vertz UI framework — signals, components, JSX runtime",
|
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
"typecheck": "tsc --noEmit"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@vertz/fetch": "^0.2.
|
|
77
|
+
"@vertz/fetch": "^0.2.25"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@happy-dom/global-registrator": "^20.7.0",
|
|
81
|
-
"@vertz/schema": "^0.2.
|
|
81
|
+
"@vertz/schema": "^0.2.25",
|
|
82
82
|
"bunup": "^0.16.31",
|
|
83
83
|
"happy-dom": "^20.7.0",
|
|
84
84
|
"typescript": "^5.7.0"
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getSSRContext
|
|
3
|
-
} from "./chunk-656n0x6y.js";
|
|
4
|
-
|
|
5
|
-
// src/dom/dom-adapter.ts
|
|
6
|
-
function createDOMAdapter() {
|
|
7
|
-
return {
|
|
8
|
-
createElement: (tag) => document.createElement(tag),
|
|
9
|
-
createElementNS: (ns, tag) => document.createElementNS(ns, tag),
|
|
10
|
-
createTextNode: (text) => document.createTextNode(text),
|
|
11
|
-
createComment: (text) => document.createComment(text),
|
|
12
|
-
createDocumentFragment: () => document.createDocumentFragment(),
|
|
13
|
-
isNode: (value) => typeof Node !== "undefined" && value instanceof Node
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// src/dom/adapter.ts
|
|
18
|
-
var RENDER_NODE_BRAND = Symbol.for("vertz:render-node");
|
|
19
|
-
function isRenderNode(value) {
|
|
20
|
-
if (value == null || typeof value !== "object")
|
|
21
|
-
return false;
|
|
22
|
-
if (RENDER_NODE_BRAND in value)
|
|
23
|
-
return true;
|
|
24
|
-
return typeof Node !== "undefined" && value instanceof Node;
|
|
25
|
-
}
|
|
26
|
-
var currentAdapter = null;
|
|
27
|
-
function getAdapter() {
|
|
28
|
-
const ctx = getSSRContext();
|
|
29
|
-
if (ctx)
|
|
30
|
-
return ctx.adapter;
|
|
31
|
-
if (!currentAdapter) {
|
|
32
|
-
currentAdapter = createDOMAdapter();
|
|
33
|
-
}
|
|
34
|
-
return currentAdapter;
|
|
35
|
-
}
|
|
36
|
-
function setAdapter(adapter) {
|
|
37
|
-
currentAdapter = adapter;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export { createDOMAdapter, RENDER_NODE_BRAND, isRenderNode, getAdapter, setAdapter };
|