@vertz/ui 0.2.19 → 0.2.21
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-4fwcwxn6.js → chunk-2qe6aqhb.js} +235 -1
- package/dist/shared/{chunk-mtsvrj9e.js → chunk-4cmt1ve8.js} +1 -1
- package/dist/shared/chunk-4xkw6h1s.js +73 -0
- package/dist/shared/{chunk-j5qtsm0b.js → chunk-67z8b0q8.js} +97 -21
- package/dist/shared/{chunk-fkbgbf3n.js → chunk-7g722pdh.js} +70 -12
- package/dist/shared/{chunk-6wd36w21.js → chunk-am9zaw4h.js} +3 -1
- package/dist/shared/{chunk-14eqne2a.js → chunk-bybgyjye.js} +1 -1
- package/dist/shared/{chunk-afawz764.js → chunk-c61572xp.js} +1 -1
- package/dist/shared/{chunk-07bh4m1e.js → chunk-kjwp5q5s.js} +10 -5
- package/dist/shared/chunk-mwc4v48d.js +36 -0
- package/dist/shared/{chunk-yjs76c7v.js → chunk-pdqr78k9.js} +1 -1
- package/dist/shared/{chunk-c3r237f0.js → chunk-pq8khh47.js} +32 -11
- package/dist/shared/{chunk-fs3eec4b.js → chunk-szk0hyjg.js} +3 -3
- package/dist/shared/chunk-vwz86vg9.js +208 -0
- package/dist/shared/{chunk-j09yyh34.js → chunk-yb4a0smw.js} +1 -1
- package/dist/src/auth/public.d.ts +30 -2
- package/dist/src/auth/public.js +95 -136
- package/dist/src/components/index.d.ts +70 -0
- package/dist/src/components/index.js +210 -0
- package/dist/src/css/public.d.ts +48 -14
- package/dist/src/css/public.js +4 -4
- package/dist/src/form/public.js +2 -2
- package/dist/src/index.d.ts +125 -20
- package/dist/src/index.js +44 -36
- package/dist/src/internals.d.ts +110 -62
- package/dist/src/internals.js +18 -14
- package/dist/src/jsx-runtime/index.d.ts +20 -0
- package/dist/src/jsx-runtime/index.js +13 -3
- package/dist/src/query/public.js +4 -4
- package/dist/src/router/public.d.ts +47 -1
- package/dist/src/router/public.js +10 -9
- package/dist/src/test/index.d.ts +33 -0
- package/dist/src/test/index.js +4 -4
- package/package.json +7 -3
- package/dist/shared/chunk-mgfrrrjq.js +0 -384
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertz/ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.21",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Vertz UI framework — signals, components, JSX runtime",
|
|
@@ -56,6 +56,10 @@
|
|
|
56
56
|
"types": "./dist/src/auth/public.d.ts",
|
|
57
57
|
"import": "./dist/src/auth/public.js"
|
|
58
58
|
},
|
|
59
|
+
"./components": {
|
|
60
|
+
"types": "./dist/src/components/index.d.ts",
|
|
61
|
+
"import": "./dist/src/components/index.js"
|
|
62
|
+
},
|
|
59
63
|
"./reactivity.json": "./reactivity.json"
|
|
60
64
|
},
|
|
61
65
|
"files": [
|
|
@@ -69,11 +73,11 @@
|
|
|
69
73
|
"typecheck": "tsc --noEmit"
|
|
70
74
|
},
|
|
71
75
|
"dependencies": {
|
|
72
|
-
"@vertz/fetch": "^0.2.
|
|
76
|
+
"@vertz/fetch": "^0.2.20"
|
|
73
77
|
},
|
|
74
78
|
"devDependencies": {
|
|
75
79
|
"@happy-dom/global-registrator": "^20.7.0",
|
|
76
|
-
"@vertz/schema": "^0.2.
|
|
80
|
+
"@vertz/schema": "^0.2.20",
|
|
77
81
|
"bunup": "^0.16.31",
|
|
78
82
|
"happy-dom": "^20.7.0",
|
|
79
83
|
"typescript": "^5.7.0"
|
|
@@ -1,384 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SVG_NS,
|
|
3
|
-
isSVGTag,
|
|
4
|
-
normalizeSVGAttr
|
|
5
|
-
} from "./chunk-prj7nm08.js";
|
|
6
|
-
import {
|
|
7
|
-
getAdapter,
|
|
8
|
-
isRenderNode
|
|
9
|
-
} from "./chunk-afawz764.js";
|
|
10
|
-
import {
|
|
11
|
-
domEffect
|
|
12
|
-
} from "./chunk-4fwcwxn6.js";
|
|
13
|
-
|
|
14
|
-
// src/hydrate/hydration-context.ts
|
|
15
|
-
var isHydrating = false;
|
|
16
|
-
var currentNode = null;
|
|
17
|
-
var cursorStack = [];
|
|
18
|
-
var hydrationRoot = null;
|
|
19
|
-
var claimedNodes = null;
|
|
20
|
-
function isDebug() {
|
|
21
|
-
if (typeof process !== "undefined" && true) {
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
return typeof globalThis !== "undefined" && globalThis.__VERTZ_HYDRATION_DEBUG__ === true;
|
|
25
|
-
}
|
|
26
|
-
function startHydration(root) {
|
|
27
|
-
if (isHydrating) {
|
|
28
|
-
throw new Error("[hydrate] startHydration() called while hydration is already active. " + "Concurrent hydration is not supported.");
|
|
29
|
-
}
|
|
30
|
-
isHydrating = true;
|
|
31
|
-
currentNode = root.firstChild;
|
|
32
|
-
cursorStack.length = 0;
|
|
33
|
-
if (isDebug()) {
|
|
34
|
-
hydrationRoot = root;
|
|
35
|
-
claimedNodes = new WeakSet;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
function endHydration() {
|
|
39
|
-
if (isDebug()) {
|
|
40
|
-
if (currentNode) {
|
|
41
|
-
console.debug("[hydrate] Hydration ended with unclaimed nodes remaining. " + "This may indicate SSR/client tree mismatch or browser extension nodes.");
|
|
42
|
-
}
|
|
43
|
-
if (cursorStack.length > 0) {
|
|
44
|
-
console.debug(`[hydrate] Hydration ended with unbalanced cursor stack (depth: ${cursorStack.length}). ` + "Check that __enterChildren/__exitChildren calls are paired.");
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
if (hydrationRoot && claimedNodes) {
|
|
48
|
-
const unclaimed = findUnclaimedNodes(hydrationRoot, claimedNodes);
|
|
49
|
-
if (unclaimed.length > 0) {
|
|
50
|
-
console.warn(`[hydrate] ${unclaimed.length} SSR node(s) not claimed during hydration:
|
|
51
|
-
` + unclaimed.map((n) => ` - ${describeNode(n)}`).join(`
|
|
52
|
-
`));
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
hydrationRoot = null;
|
|
56
|
-
claimedNodes = null;
|
|
57
|
-
isHydrating = false;
|
|
58
|
-
currentNode = null;
|
|
59
|
-
cursorStack.length = 0;
|
|
60
|
-
}
|
|
61
|
-
function getIsHydrating() {
|
|
62
|
-
return isHydrating;
|
|
63
|
-
}
|
|
64
|
-
function pauseHydration() {
|
|
65
|
-
isHydrating = false;
|
|
66
|
-
}
|
|
67
|
-
function resumeHydration() {
|
|
68
|
-
isHydrating = true;
|
|
69
|
-
}
|
|
70
|
-
function claimElement(tag) {
|
|
71
|
-
const upperTag = tag.toUpperCase();
|
|
72
|
-
while (currentNode) {
|
|
73
|
-
if (currentNode.nodeType === Node.ELEMENT_NODE) {
|
|
74
|
-
const el = currentNode;
|
|
75
|
-
if (el.tagName === upperTag) {
|
|
76
|
-
if (isDebug()) {
|
|
77
|
-
const id = el.id ? `#${el.id}` : "";
|
|
78
|
-
const cls = el.className ? `.${el.className.split(" ")[0]}` : "";
|
|
79
|
-
console.debug(`[hydrate] claimElement(<${tag}${id}${cls}>) ✓ depth=${cursorStack.length}`);
|
|
80
|
-
}
|
|
81
|
-
if (claimedNodes)
|
|
82
|
-
claimedNodes.add(el);
|
|
83
|
-
currentNode = el.nextSibling;
|
|
84
|
-
return el;
|
|
85
|
-
}
|
|
86
|
-
if (isDebug()) {
|
|
87
|
-
console.debug(`[hydrate] Skipping non-matching node: <${el.tagName.toLowerCase()}> (expected <${tag}>)`);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
currentNode = currentNode.nextSibling;
|
|
91
|
-
}
|
|
92
|
-
if (isDebug()) {
|
|
93
|
-
console.warn(`[hydrate] Expected <${tag}> but no matching SSR node found. Creating new element.`);
|
|
94
|
-
}
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
function claimText() {
|
|
98
|
-
while (currentNode) {
|
|
99
|
-
if (currentNode.nodeType === Node.TEXT_NODE) {
|
|
100
|
-
const text = currentNode;
|
|
101
|
-
if (isDebug()) {
|
|
102
|
-
const preview = text.data.length > 30 ? text.data.slice(0, 30) + "..." : text.data;
|
|
103
|
-
console.debug(`[hydrate] claimText("${preview}") ✓ depth=${cursorStack.length}`);
|
|
104
|
-
}
|
|
105
|
-
if (claimedNodes)
|
|
106
|
-
claimedNodes.add(text);
|
|
107
|
-
currentNode = text.nextSibling;
|
|
108
|
-
return text;
|
|
109
|
-
}
|
|
110
|
-
if (currentNode.nodeType === Node.ELEMENT_NODE) {
|
|
111
|
-
break;
|
|
112
|
-
}
|
|
113
|
-
currentNode = currentNode.nextSibling;
|
|
114
|
-
}
|
|
115
|
-
if (isDebug()) {
|
|
116
|
-
console.warn("[hydrate] Expected text node but no matching SSR node found.");
|
|
117
|
-
}
|
|
118
|
-
return null;
|
|
119
|
-
}
|
|
120
|
-
function claimComment() {
|
|
121
|
-
while (currentNode) {
|
|
122
|
-
if (currentNode.nodeType === Node.COMMENT_NODE) {
|
|
123
|
-
const comment = currentNode;
|
|
124
|
-
if (claimedNodes)
|
|
125
|
-
claimedNodes.add(comment);
|
|
126
|
-
currentNode = comment.nextSibling;
|
|
127
|
-
return comment;
|
|
128
|
-
}
|
|
129
|
-
currentNode = currentNode.nextSibling;
|
|
130
|
-
}
|
|
131
|
-
if (isDebug()) {
|
|
132
|
-
console.warn("[hydrate] Expected comment node but no matching SSR node found.");
|
|
133
|
-
}
|
|
134
|
-
return null;
|
|
135
|
-
}
|
|
136
|
-
function enterChildren(el) {
|
|
137
|
-
cursorStack.push(currentNode);
|
|
138
|
-
currentNode = el.firstChild;
|
|
139
|
-
}
|
|
140
|
-
function exitChildren() {
|
|
141
|
-
if (cursorStack.length === 0) {
|
|
142
|
-
if (isDebug()) {
|
|
143
|
-
console.warn("[hydrate] exitChildren() called with empty stack. " + "This likely means __exitChildren was called without a matching __enterChildren.");
|
|
144
|
-
}
|
|
145
|
-
currentNode = null;
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
currentNode = cursorStack.pop() ?? null;
|
|
149
|
-
}
|
|
150
|
-
function findUnclaimedNodes(root, claimed) {
|
|
151
|
-
const unclaimed = [];
|
|
152
|
-
function walk(node) {
|
|
153
|
-
let child = node.firstChild;
|
|
154
|
-
while (child) {
|
|
155
|
-
if (child.nodeType === Node.ELEMENT_NODE) {
|
|
156
|
-
const el = child;
|
|
157
|
-
if (el.tagName.includes("-")) {
|
|
158
|
-
child = child.nextSibling;
|
|
159
|
-
continue;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
if (child.nodeType === Node.ELEMENT_NODE && claimed.has(child) && child.tagName === "SPAN" && child.style.display === "contents") {
|
|
163
|
-
child = child.nextSibling;
|
|
164
|
-
continue;
|
|
165
|
-
}
|
|
166
|
-
if (!claimed.has(child)) {
|
|
167
|
-
if (child.nodeType === Node.ELEMENT_NODE || child.nodeType === Node.TEXT_NODE || child.nodeType === Node.COMMENT_NODE) {
|
|
168
|
-
unclaimed.push(child);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
if (child.nodeType === Node.ELEMENT_NODE) {
|
|
172
|
-
walk(child);
|
|
173
|
-
}
|
|
174
|
-
child = child.nextSibling;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
walk(root);
|
|
178
|
-
return unclaimed;
|
|
179
|
-
}
|
|
180
|
-
function describeNode(node) {
|
|
181
|
-
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
182
|
-
const el = node;
|
|
183
|
-
const id = el.id ? `#${el.id}` : "";
|
|
184
|
-
const cls = el.className ? `.${String(el.className).split(" ")[0]}` : "";
|
|
185
|
-
return `<${el.tagName.toLowerCase()}${id}${cls}>`;
|
|
186
|
-
}
|
|
187
|
-
if (node.nodeType === Node.TEXT_NODE) {
|
|
188
|
-
const data = node.data;
|
|
189
|
-
const preview = data.length > 20 ? data.slice(0, 20) + "..." : data;
|
|
190
|
-
return `text("${preview}")`;
|
|
191
|
-
}
|
|
192
|
-
if (node.nodeType === Node.COMMENT_NODE) {
|
|
193
|
-
return `<!-- ${node.data} -->`;
|
|
194
|
-
}
|
|
195
|
-
return `[node type=${node.nodeType}]`;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
// src/dom/element.ts
|
|
199
|
-
var MAX_THUNK_DEPTH = 100;
|
|
200
|
-
function resolveAndAppend(parent, value, depth = 0) {
|
|
201
|
-
if (depth >= MAX_THUNK_DEPTH) {
|
|
202
|
-
throw new Error("resolveAndAppend: max recursion depth exceeded — possible circular thunk");
|
|
203
|
-
}
|
|
204
|
-
if (value == null || typeof value === "boolean") {
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
if (typeof value === "function") {
|
|
208
|
-
resolveAndAppend(parent, value(), depth + 1);
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
if (Array.isArray(value)) {
|
|
212
|
-
for (const item of value) {
|
|
213
|
-
resolveAndAppend(parent, item, depth);
|
|
214
|
-
}
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
if (isRenderNode(value)) {
|
|
218
|
-
parent.appendChild(value);
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
const text = typeof value === "string" ? value : String(value);
|
|
222
|
-
parent.appendChild(getAdapter().createTextNode(text));
|
|
223
|
-
}
|
|
224
|
-
function __text(fn) {
|
|
225
|
-
if (getIsHydrating()) {
|
|
226
|
-
const claimed = claimText();
|
|
227
|
-
if (claimed) {
|
|
228
|
-
const node2 = claimed;
|
|
229
|
-
node2.dispose = domEffect(() => {
|
|
230
|
-
node2.data = fn();
|
|
231
|
-
});
|
|
232
|
-
return node2;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
const node = getAdapter().createTextNode("");
|
|
236
|
-
node.dispose = domEffect(() => {
|
|
237
|
-
node.data = fn();
|
|
238
|
-
});
|
|
239
|
-
return node;
|
|
240
|
-
}
|
|
241
|
-
function __child(fn) {
|
|
242
|
-
let wrapper;
|
|
243
|
-
if (getIsHydrating()) {
|
|
244
|
-
const claimed = claimElement("span");
|
|
245
|
-
if (claimed) {
|
|
246
|
-
wrapper = claimed;
|
|
247
|
-
while (wrapper.firstChild) {
|
|
248
|
-
wrapper.removeChild(wrapper.firstChild);
|
|
249
|
-
}
|
|
250
|
-
pauseHydration();
|
|
251
|
-
try {
|
|
252
|
-
wrapper.dispose = domEffect(() => {
|
|
253
|
-
const value = fn();
|
|
254
|
-
if (isRenderNode(value) && wrapper.childNodes.length === 1 && wrapper.firstChild === value) {
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
if (!isRenderNode(value) && value != null && typeof value !== "boolean" && wrapper.childNodes.length === 1 && wrapper.firstChild.nodeType === 3) {
|
|
258
|
-
const text = typeof value === "string" ? value : String(value);
|
|
259
|
-
wrapper.firstChild.data = text;
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
while (wrapper.firstChild) {
|
|
263
|
-
wrapper.removeChild(wrapper.firstChild);
|
|
264
|
-
}
|
|
265
|
-
resolveAndAppend(wrapper, value);
|
|
266
|
-
});
|
|
267
|
-
} finally {
|
|
268
|
-
resumeHydration();
|
|
269
|
-
}
|
|
270
|
-
return wrapper;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
wrapper = getAdapter().createElement("span");
|
|
274
|
-
wrapper.style.display = "contents";
|
|
275
|
-
wrapper.dispose = domEffect(() => {
|
|
276
|
-
const value = fn();
|
|
277
|
-
if (isRenderNode(value) && wrapper.childNodes.length === 1 && wrapper.firstChild === value) {
|
|
278
|
-
return;
|
|
279
|
-
}
|
|
280
|
-
if (!isRenderNode(value) && value != null && typeof value !== "boolean" && typeof value !== "function" && wrapper.childNodes.length === 1 && wrapper.firstChild.nodeType === 3) {
|
|
281
|
-
const text = typeof value === "string" ? value : String(value);
|
|
282
|
-
wrapper.firstChild.data = text;
|
|
283
|
-
return;
|
|
284
|
-
}
|
|
285
|
-
while (wrapper.firstChild) {
|
|
286
|
-
wrapper.removeChild(wrapper.firstChild);
|
|
287
|
-
}
|
|
288
|
-
resolveAndAppend(wrapper, value);
|
|
289
|
-
});
|
|
290
|
-
return wrapper;
|
|
291
|
-
}
|
|
292
|
-
function resolveAndInsert(parent, value, depth = 0) {
|
|
293
|
-
if (depth >= MAX_THUNK_DEPTH) {
|
|
294
|
-
throw new Error("__insert: max recursion depth exceeded — possible circular thunk");
|
|
295
|
-
}
|
|
296
|
-
if (value == null || typeof value === "boolean") {
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
if (typeof value === "function") {
|
|
300
|
-
resolveAndInsert(parent, value(), depth + 1);
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
|
-
if (Array.isArray(value)) {
|
|
304
|
-
for (const item of value) {
|
|
305
|
-
resolveAndInsert(parent, item, depth);
|
|
306
|
-
}
|
|
307
|
-
return;
|
|
308
|
-
}
|
|
309
|
-
insertLeaf(parent, value);
|
|
310
|
-
}
|
|
311
|
-
function insertLeaf(parent, value) {
|
|
312
|
-
if (getIsHydrating()) {
|
|
313
|
-
if (isRenderNode(value)) {
|
|
314
|
-
return;
|
|
315
|
-
}
|
|
316
|
-
claimText();
|
|
317
|
-
return;
|
|
318
|
-
}
|
|
319
|
-
if (isRenderNode(value)) {
|
|
320
|
-
parent.appendChild(value);
|
|
321
|
-
return;
|
|
322
|
-
}
|
|
323
|
-
const text = typeof value === "string" ? value : String(value);
|
|
324
|
-
parent.appendChild(getAdapter().createTextNode(text));
|
|
325
|
-
}
|
|
326
|
-
function __insert(parent, value) {
|
|
327
|
-
if (value == null || typeof value === "boolean") {
|
|
328
|
-
return;
|
|
329
|
-
}
|
|
330
|
-
resolveAndInsert(parent, value);
|
|
331
|
-
}
|
|
332
|
-
function __element(tag, props) {
|
|
333
|
-
if (getIsHydrating()) {
|
|
334
|
-
const claimed = claimElement(tag);
|
|
335
|
-
if (claimed) {
|
|
336
|
-
if (props && typeof process !== "undefined" && true) {
|
|
337
|
-
for (const [key, value] of Object.entries(props)) {
|
|
338
|
-
if (key === "role" || key.startsWith("aria-")) {
|
|
339
|
-
const actual = claimed.getAttribute(key);
|
|
340
|
-
if (actual !== value) {
|
|
341
|
-
console.warn(`[hydrate] ARIA mismatch on <${tag}>: ${key}="${actual}" (expected "${value}")`);
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
return claimed;
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
const adapter = getAdapter();
|
|
350
|
-
const svg = isSVGTag(tag);
|
|
351
|
-
const el = svg ? adapter.createElementNS(SVG_NS, tag) : adapter.createElement(tag);
|
|
352
|
-
if (props) {
|
|
353
|
-
for (const [key, value] of Object.entries(props)) {
|
|
354
|
-
const attrName = svg ? normalizeSVGAttr(key) : key;
|
|
355
|
-
el.setAttribute(attrName, value);
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
return el;
|
|
359
|
-
}
|
|
360
|
-
function __append(parent, child) {
|
|
361
|
-
if (getIsHydrating())
|
|
362
|
-
return;
|
|
363
|
-
parent.appendChild(child);
|
|
364
|
-
}
|
|
365
|
-
function __staticText(text) {
|
|
366
|
-
if (getIsHydrating()) {
|
|
367
|
-
const claimed = claimText();
|
|
368
|
-
if (claimed)
|
|
369
|
-
return claimed;
|
|
370
|
-
}
|
|
371
|
-
return getAdapter().createTextNode(text);
|
|
372
|
-
}
|
|
373
|
-
function __enterChildren(el) {
|
|
374
|
-
if (getIsHydrating()) {
|
|
375
|
-
enterChildren(el);
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
function __exitChildren() {
|
|
379
|
-
if (getIsHydrating()) {
|
|
380
|
-
exitChildren();
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
export { startHydration, endHydration, getIsHydrating, claimElement, claimText, claimComment, enterChildren, exitChildren, __text, __child, __insert, __element, __append, __staticText, __enterChildren, __exitChildren };
|