@fun-land/fun-web 0.5.0 → 0.6.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/README.md +157 -92
- package/dist/esm/src/dom.d.ts +44 -2
- package/dist/esm/src/dom.js +57 -2
- package/dist/esm/src/dom.js.map +1 -1
- package/dist/esm/src/index.d.ts +1 -3
- package/dist/esm/src/index.js +1 -2
- package/dist/esm/src/index.js.map +1 -1
- package/dist/esm/tsconfig.publish.tsbuildinfo +1 -1
- package/dist/src/dom.d.ts +44 -2
- package/dist/src/dom.js +61 -5
- package/dist/src/dom.js.map +1 -1
- package/dist/src/index.d.ts +1 -3
- package/dist/src/index.js +16 -19
- package/dist/src/index.js.map +1 -1
- package/dist/tsconfig.publish.tsbuildinfo +1 -1
- package/examples/counter/counter.ts +2 -7
- package/examples/todo-app/DraggableTodoList.ts +1 -1
- package/examples/todo-app/Todo.ts +28 -30
- package/examples/todo-app/TodoApp.ts +7 -16
- package/package.json +3 -3
- package/src/dom.test.ts +65 -354
- package/src/dom.ts +134 -3
- package/src/index.ts +1 -20
- package/src/state.test.ts +0 -251
- package/src/state.ts +0 -2
package/README.md
CHANGED
|
@@ -31,12 +31,9 @@ pnpm add @fun-land/fun-web @fun-land/accessor
|
|
|
31
31
|
|
|
32
32
|
```typescript
|
|
33
33
|
import {
|
|
34
|
-
|
|
34
|
+
hx,
|
|
35
35
|
funState,
|
|
36
36
|
mount,
|
|
37
|
-
bindProperty,
|
|
38
|
-
on,
|
|
39
|
-
enhance,
|
|
40
37
|
type Component,
|
|
41
38
|
type FunState,
|
|
42
39
|
} from "@fun-land/fun-web";
|
|
@@ -44,15 +41,13 @@ import {
|
|
|
44
41
|
|
|
45
42
|
const Counter: Component<{state: FunState<number>}> = (signal, {state}) => {
|
|
46
43
|
// Component runs once - no re-rendering on state changes
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return button;
|
|
44
|
+
return hx("button", {
|
|
45
|
+
signal,
|
|
46
|
+
// bind syncs the button text with state
|
|
47
|
+
bind: { textContent: state },
|
|
48
|
+
// Event handlers never go stale (component doesn't re-run)
|
|
49
|
+
on: { click: () => state.mod((n) => n + 1) },
|
|
50
|
+
});
|
|
56
51
|
};
|
|
57
52
|
|
|
58
53
|
// Create reactive state and mount
|
|
@@ -69,12 +64,16 @@ const mounted = mount(Counter, { state: funState(0) }, document.body);
|
|
|
69
64
|
const Counter: Component<{ count: FunState<number> }> = (signal, props) => {
|
|
70
65
|
console.log("Component runs once");
|
|
71
66
|
|
|
72
|
-
const display =
|
|
73
|
-
|
|
67
|
+
const display = hx("div", {
|
|
68
|
+
signal,
|
|
69
|
+
bind: { textContent: props.count },
|
|
70
|
+
});
|
|
74
71
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
const button = hx("button", {
|
|
73
|
+
signal,
|
|
74
|
+
props: { textContent: "Increment" },
|
|
75
|
+
on: { click: () => props.count.mod(n => n + 1) },
|
|
76
|
+
});
|
|
78
77
|
|
|
79
78
|
return h("div", {}, [display, button]);
|
|
80
79
|
// Component function exits, but subscriptions keep working
|
|
@@ -117,12 +116,17 @@ function ReactCounter() {
|
|
|
117
116
|
const FunWebCounter: Component<{ count: FunState<number> }> = (signal, props) => {
|
|
118
117
|
console.log("Mounting!"); // Logs once, never again
|
|
119
118
|
|
|
120
|
-
const display =
|
|
121
|
-
|
|
119
|
+
const display = hx("div", {
|
|
120
|
+
signal,
|
|
121
|
+
bind: { textContent: props.count },
|
|
122
|
+
});
|
|
122
123
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
const button = hx("button", {
|
|
125
|
+
signal,
|
|
126
|
+
props: { textContent: "+" },
|
|
127
|
+
// No useCallback needed - this closure never goes stale
|
|
128
|
+
on: { click: () => props.count.mod(n => n + 1) },
|
|
129
|
+
});
|
|
126
130
|
|
|
127
131
|
return h("div", {}, [display, button]);
|
|
128
132
|
};
|
|
@@ -186,33 +190,42 @@ const Dashboard: Component<{
|
|
|
186
190
|
|
|
187
191
|
### Reactivity Patterns
|
|
188
192
|
|
|
189
|
-
**
|
|
193
|
+
**One-way binding with `hx`:**
|
|
190
194
|
|
|
191
195
|
```typescript
|
|
192
|
-
const nameEl = h("div");
|
|
193
196
|
const nameState: FunState<string> = state.prop("user").prop("name");
|
|
194
197
|
|
|
195
|
-
|
|
198
|
+
const nameEl = hx("div", {
|
|
199
|
+
signal,
|
|
200
|
+
bind: { textContent: nameState },
|
|
201
|
+
});
|
|
196
202
|
// nameEl.textContent stays in sync with nameState
|
|
197
203
|
```
|
|
198
204
|
|
|
199
|
-
**
|
|
205
|
+
**Two-way binding with `hx`:**
|
|
200
206
|
|
|
201
207
|
```typescript
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
},
|
|
208
|
+
const input = hx("input", {
|
|
209
|
+
signal,
|
|
210
|
+
props: { type: "text" },
|
|
211
|
+
bind: { value: state.prop("name") },
|
|
212
|
+
on: { input: (e) => state.prop("name").set(e.currentTarget.value) },
|
|
213
|
+
});
|
|
206
214
|
```
|
|
207
215
|
|
|
208
|
-
**
|
|
216
|
+
**Event handlers with `hx`:**
|
|
209
217
|
|
|
210
218
|
```typescript
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
on
|
|
215
|
-
)
|
|
219
|
+
const button = hx("button", {
|
|
220
|
+
signal,
|
|
221
|
+
props: { textContent: "Click me" },
|
|
222
|
+
on: {
|
|
223
|
+
click: (e) => {
|
|
224
|
+
console.log(e.currentTarget.textContent);
|
|
225
|
+
e.currentTarget.disabled = true; // type-safe!
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
});
|
|
216
229
|
```
|
|
217
230
|
|
|
218
231
|
**Use `.watch()` for complex logic:**
|
|
@@ -225,6 +238,17 @@ state.watch(signal, (s) => {
|
|
|
225
238
|
});
|
|
226
239
|
```
|
|
227
240
|
|
|
241
|
+
**Using enhancers (alternative to `hx`):**
|
|
242
|
+
|
|
243
|
+
```typescript
|
|
244
|
+
// If you prefer functional composition
|
|
245
|
+
const input = enhance(
|
|
246
|
+
h("input", { type: "text" }),
|
|
247
|
+
bindProperty("value", state.prop("name"), signal),
|
|
248
|
+
on("input", (e) => state.prop("name").set(e.currentTarget.value), signal)
|
|
249
|
+
);
|
|
250
|
+
```
|
|
251
|
+
|
|
228
252
|
### Cleanup with AbortSignal
|
|
229
253
|
|
|
230
254
|
All subscriptions and event listeners require an AbortSignal. When the signal aborts, everything cleans up automatically:
|
|
@@ -253,7 +277,7 @@ For the most part you won't have to worry about the abort signal if you use the
|
|
|
253
277
|
**Don't have one big app state**
|
|
254
278
|
This isn't redux. There's little reason to create giant state objects. Create state near the leaves and hoist it when you need to. That said
|
|
255
279
|
|
|
256
|
-
**You can have more
|
|
280
|
+
**You can have more than one state**
|
|
257
281
|
It's just a value. If having one state manage multiple properties works then great but if you want to have several that's fine too.
|
|
258
282
|
|
|
259
283
|
**Deep chains of .prop() are a smell**
|
|
@@ -266,37 +290,49 @@ const bazFromState = Acc<MyState>().prop('foo').prop('bar').prop('baz')
|
|
|
266
290
|
const baz = state.focus(bazFromState).get()
|
|
267
291
|
```
|
|
268
292
|
|
|
269
|
-
**
|
|
293
|
+
**Using .get() in component scope is a smell**
|
|
294
|
+
State is for when you want components to respond to state changes as such you should be using it with bindProperty or state.watch or inside event handlers. There are many cases for .get() but if it's the first thing you reach for you're probably gonna be confused that the UI isn't updating.
|
|
295
|
+
|
|
296
|
+
**Prefer `hx` for reactive elements:**
|
|
270
297
|
|
|
271
298
|
```typescript
|
|
272
|
-
// ✅ Good
|
|
273
|
-
|
|
299
|
+
// ✅ Good - declarative and type-safe
|
|
300
|
+
const input = hx("input", {
|
|
301
|
+
signal,
|
|
302
|
+
props: { type: "text" },
|
|
303
|
+
bind: { value: state.prop("name") },
|
|
304
|
+
on: { input: (e) => state.prop("name").set(e.currentTarget.value) },
|
|
305
|
+
});
|
|
274
306
|
|
|
275
|
-
//
|
|
276
|
-
|
|
277
|
-
|
|
307
|
+
// ✅ Also good - functional composition with enhancers
|
|
308
|
+
const input = enhance(
|
|
309
|
+
h("input", { type: "text" }),
|
|
310
|
+
bindProperty("value", state.prop("name"), signal),
|
|
311
|
+
on("input", (e) => state.prop("name").set(e.currentTarget.value), signal)
|
|
312
|
+
);
|
|
313
|
+
|
|
314
|
+
// ❌ Avoid manual subscriptions when `bind` works
|
|
315
|
+
const input = h("input", { type: "text" });
|
|
316
|
+
state.prop("name").watch(signal, (name) => {
|
|
317
|
+
input.value = name; // Just use bind!
|
|
278
318
|
});
|
|
279
319
|
```
|
|
280
320
|
|
|
281
|
-
**
|
|
321
|
+
**Don't bind events in `h()` props:**
|
|
282
322
|
|
|
283
323
|
```typescript
|
|
284
|
-
// ✅ Good -
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
},
|
|
288
|
-
|
|
289
|
-
// ❌ Avoid - loses type information
|
|
290
|
-
button.addEventListener("click", (e) => {
|
|
291
|
-
(e.currentTarget as HTMLButtonElement).disabled = true;
|
|
292
|
-
}); // ❌ Forgot {signal} !
|
|
324
|
+
// ✅ Good - uses hx with type-safe events
|
|
325
|
+
const button = hx("button", {
|
|
326
|
+
signal,
|
|
327
|
+
on: { click: (e) => e.currentTarget.disabled = true },
|
|
328
|
+
});
|
|
293
329
|
|
|
294
|
-
// ❌ Avoid
|
|
295
|
-
h(
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
// ❌ event handler not cleaned up!
|
|
299
|
-
}
|
|
330
|
+
// ❌ Avoid - h() event props aren't cleaned up and lose types
|
|
331
|
+
const button = h("button", {
|
|
332
|
+
onclick: (e) => {
|
|
333
|
+
(e.currentTarget as HTMLButtonElement).disabled = true; // needs cast
|
|
334
|
+
}, // ❌ event handler not cleaned up!
|
|
335
|
+
});
|
|
300
336
|
```
|
|
301
337
|
|
|
302
338
|
**Manual subscriptions for complex updates:**
|
|
@@ -319,9 +355,30 @@ state.watch(signal, (s) => {
|
|
|
319
355
|
|
|
320
356
|
### DOM Utilities
|
|
321
357
|
|
|
358
|
+
#### `hx` (recommended)
|
|
359
|
+
|
|
360
|
+
Create elements with structured props, attrs, event handlers, and reactive bindings. More complex but provides better type safety and ergonomics than `h` + enhancers.
|
|
361
|
+
|
|
362
|
+
```typescript
|
|
363
|
+
const input = hx("input", {
|
|
364
|
+
signal,
|
|
365
|
+
props: { type: "text", placeholder: "Enter name" },
|
|
366
|
+
attrs: { "data-test": "name-input" },
|
|
367
|
+
bind: { value: nameState },
|
|
368
|
+
on: { input: (e) => nameState.set(e.currentTarget.value) },
|
|
369
|
+
});
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
**Parameters:**
|
|
373
|
+
- `props` - Element properties (typed per element, writable properties only)
|
|
374
|
+
- `attrs` - HTML attributes (data-*, aria-*, etc.)
|
|
375
|
+
- `on` - Event handlers (type-safe, with inferred `currentTarget`)
|
|
376
|
+
- `bind` - Reactive bindings (properties sync with FunState)
|
|
377
|
+
- `signal` - **Required** AbortSignal for cleanup
|
|
378
|
+
|
|
322
379
|
#### `h`
|
|
323
380
|
|
|
324
|
-
|
|
381
|
+
Create HTML elements declaratively. Consider using `hx` if you want to add event handlers or respond to state changes.
|
|
325
382
|
|
|
326
383
|
```typescript
|
|
327
384
|
const div = h("div", { id: "app" }, [
|
|
@@ -332,12 +389,12 @@ const div = h("div", { id: "app" }, [
|
|
|
332
389
|
|
|
333
390
|
**Attribute conventions:**
|
|
334
391
|
- Dashed properties (`data-*`, `aria-*`) → `setAttribute()`
|
|
335
|
-
-
|
|
392
|
+
- Properties starting with `on` → event listeners (⚠️ not cleaned up, use `hx` or `on()` enhancer)
|
|
336
393
|
- Everything else → property assignment
|
|
337
394
|
|
|
338
395
|
#### bindProperty
|
|
339
396
|
|
|
340
|
-
Bind element property to state. Returns `Enhancer`.
|
|
397
|
+
Bind element property to state. Returns `Enhancer`. Consider using `hx` with `bind` for better ergonomics.
|
|
341
398
|
|
|
342
399
|
```typescript
|
|
343
400
|
const input = enhance(
|
|
@@ -345,11 +402,17 @@ const input = enhance(
|
|
|
345
402
|
bindProperty("value", state.prop("name"), signal)
|
|
346
403
|
);
|
|
347
404
|
// input.value syncs with state.name
|
|
405
|
+
|
|
406
|
+
// Equivalent with hx:
|
|
407
|
+
const input = hx("input", {
|
|
408
|
+
signal,
|
|
409
|
+
bind: { value: state.prop("name") },
|
|
410
|
+
});
|
|
348
411
|
```
|
|
349
412
|
|
|
350
413
|
#### on
|
|
351
414
|
|
|
352
|
-
Add type-safe event listener. Returns `Enhancer`.
|
|
415
|
+
Add type-safe event listener. Returns `Enhancer`. Consider using `hx` with `on` for better ergonomics.
|
|
353
416
|
|
|
354
417
|
```typescript
|
|
355
418
|
const button = enhance(
|
|
@@ -358,11 +421,21 @@ const button = enhance(
|
|
|
358
421
|
e.currentTarget.disabled = true;
|
|
359
422
|
}, signal)
|
|
360
423
|
);
|
|
424
|
+
|
|
425
|
+
// Equivalent with hx:
|
|
426
|
+
const button = hx("button", {
|
|
427
|
+
signal,
|
|
428
|
+
on: {
|
|
429
|
+
click: (e) => {
|
|
430
|
+
e.currentTarget.disabled = true;
|
|
431
|
+
}
|
|
432
|
+
},
|
|
433
|
+
});
|
|
361
434
|
```
|
|
362
435
|
|
|
363
436
|
#### bindListChildren
|
|
364
437
|
|
|
365
|
-
Render
|
|
438
|
+
Render a list of items from a state array. Each row gets its own AbortSignal for cleanup and a focused state. Returns `Enhancer`.
|
|
366
439
|
|
|
367
440
|
```typescript
|
|
368
441
|
import { Acc } from "@fun-land/accessor";
|
|
@@ -382,7 +455,7 @@ const list = enhance(
|
|
|
382
455
|
bindListChildren({
|
|
383
456
|
signal,
|
|
384
457
|
state: todos,
|
|
385
|
-
key:
|
|
458
|
+
key: prop<Todo>()("id"), // key is an accessor that targets the unique string value in your array items
|
|
386
459
|
row: ({ signal, state, remove }) => {
|
|
387
460
|
const li = h("li");
|
|
388
461
|
|
|
@@ -435,10 +508,11 @@ const App: Component = (signal) => {
|
|
|
435
508
|
const showDetailsState = funState(false);
|
|
436
509
|
const userState = funState({ email: "alice@example.com", joinDate: "2024" });
|
|
437
510
|
|
|
438
|
-
const toggleBtn =
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
511
|
+
const toggleBtn = hx("button", {
|
|
512
|
+
signal,
|
|
513
|
+
props: { textContent: "Toggle Details" },
|
|
514
|
+
on: { click: () => showDetailsState.mod(show => !show) },
|
|
515
|
+
});
|
|
442
516
|
|
|
443
517
|
// Details component mounts/unmounts based on showDetailsState
|
|
444
518
|
const detailsEl = renderWhen({
|
|
@@ -495,38 +569,30 @@ showState.watch(signal, (show) => {
|
|
|
495
569
|
});
|
|
496
570
|
```
|
|
497
571
|
|
|
498
|
-
####
|
|
499
|
-
|
|
500
|
-
Convenient shortcuts for `querySelector` and `querySelectorAll` with better TypeScript support.
|
|
501
|
-
|
|
502
|
-
**`$<T extends Element>(selector: string): T | undefined`**
|
|
572
|
+
#### querySelectorAll
|
|
503
573
|
|
|
504
|
-
Query
|
|
574
|
+
Query multiple elements. Returns a real Array (not NodeList) for better ergonomics.
|
|
505
575
|
|
|
506
576
|
```typescript
|
|
507
|
-
const
|
|
508
|
-
if (button) {
|
|
509
|
-
button.disabled = true;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
const input = $<HTMLInputElement>(".name-input");
|
|
577
|
+
const items = querySelectorAll<HTMLDivElement>(".item").map(addClass("active"));
|
|
513
578
|
```
|
|
514
579
|
|
|
515
|
-
|
|
580
|
+
#### enhance
|
|
516
581
|
|
|
517
|
-
|
|
582
|
+
Apply multiple enhancers to an element. Useful with `h()` and the enhancer utilities below.
|
|
518
583
|
|
|
519
584
|
```typescript
|
|
520
|
-
const
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
585
|
+
const input = enhance(
|
|
586
|
+
h("input", { type: "text" }),
|
|
587
|
+
addClass("form-control"),
|
|
588
|
+
bindProperty("value", nameState, signal),
|
|
589
|
+
on("input", (e) => nameState.set(e.currentTarget.value), signal)
|
|
590
|
+
);
|
|
525
591
|
```
|
|
526
592
|
|
|
527
593
|
#### Other utilities
|
|
528
594
|
|
|
529
|
-
All return the element for chaining:
|
|
595
|
+
All return the element for chaining (used with `enhance`):
|
|
530
596
|
|
|
531
597
|
```typescript
|
|
532
598
|
text: (content: string | number) => (el: Element) => Element
|
|
@@ -536,8 +602,6 @@ addClass: (...classes: string[]) => (el: Element) => Element
|
|
|
536
602
|
removeClass: (...classes: string[]) => (el: Element) => Element
|
|
537
603
|
toggleClass: (className: string, force?: boolean) => (el: Element) => Element
|
|
538
604
|
append: (...children: Element[]) => (el: Element) => Element
|
|
539
|
-
// pipe a value through a series of endomorphisms
|
|
540
|
-
pipeAll: <T>(x: T, ...fns: Array<(x: T) => T>) => T
|
|
541
605
|
```
|
|
542
606
|
|
|
543
607
|
### Mounting
|
|
@@ -573,6 +637,7 @@ interface MountedComponent {
|
|
|
573
637
|
Components compose by calling other components and passing focused state via props:
|
|
574
638
|
|
|
575
639
|
```typescript
|
|
640
|
+
import { h } from "@fun-land/fun-web";
|
|
576
641
|
import { prop } from "@fun-land/accessor";
|
|
577
642
|
import { UserProfile, UserData } from "./UserProfile";
|
|
578
643
|
import { SettingsPanel, Settings } from "./Settings";
|
package/dist/esm/src/dom.d.ts
CHANGED
|
@@ -16,6 +16,46 @@ export type Enhancer<El extends Element> = (element: El) => El;
|
|
|
16
16
|
* h('div', {id: 'app', 'data-test': 'foo'}, [child1, child2])
|
|
17
17
|
*/
|
|
18
18
|
export declare const h: <Tag extends keyof HTMLElementTagNameMap>(tag: Tag, attrs?: Record<string, any> | null, children?: ElementChild | ElementChild[]) => HTMLElementTagNameMap[Tag];
|
|
19
|
+
type WritableKeys<T> = {
|
|
20
|
+
[K in keyof T]-?: (<F>() => F extends {
|
|
21
|
+
[Q in K]: T[K];
|
|
22
|
+
} ? 1 : 2) extends <F>() => F extends {
|
|
23
|
+
-readonly [Q in K]: T[K];
|
|
24
|
+
} ? 1 : 2 ? K : never;
|
|
25
|
+
}[keyof T];
|
|
26
|
+
type HxProps<El extends Element> = Partial<{
|
|
27
|
+
[K in WritableKeys<El> & string]: El[K] | null | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
type HxHandlers<El extends Element> = Partial<{
|
|
30
|
+
[K in keyof GlobalEventHandlersEventMap]: (ev: GlobalEventHandlersEventMap[K] & {
|
|
31
|
+
currentTarget: El;
|
|
32
|
+
}) => void;
|
|
33
|
+
}>;
|
|
34
|
+
type HxBindings<El extends Element> = Partial<{
|
|
35
|
+
[K in WritableKeys<El> & string]: FunState<El[K]>;
|
|
36
|
+
}>;
|
|
37
|
+
type HxOptionsBase<El extends Element> = {
|
|
38
|
+
props?: HxProps<El>;
|
|
39
|
+
attrs?: Record<string, string | number | boolean | null | undefined>;
|
|
40
|
+
};
|
|
41
|
+
type HxOptions<El extends Element> = HxOptionsBase<El> & {
|
|
42
|
+
signal: AbortSignal;
|
|
43
|
+
on?: HxHandlers<El>;
|
|
44
|
+
bind?: HxBindings<El>;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Create an element with structured props, attrs, event handlers, and bindings.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* hx("input", {
|
|
51
|
+
* signal,
|
|
52
|
+
* props: { type: "text" },
|
|
53
|
+
* attrs: { "data-test": "name" },
|
|
54
|
+
* bind: { value: nameState },
|
|
55
|
+
* on: { input: (e) => nameState.set(e.currentTarget.value) },
|
|
56
|
+
* });
|
|
57
|
+
*/
|
|
58
|
+
export declare function hx<Tag extends keyof HTMLElementTagNameMap>(tag: Tag, options: HxOptions<HTMLElementTagNameMap[Tag]>, children?: ElementChild | ElementChild[]): HTMLElementTagNameMap[Tag];
|
|
19
59
|
/**
|
|
20
60
|
* Set text content of an element (returns element for chaining)
|
|
21
61
|
* @returns {Enhancer}
|
|
@@ -120,5 +160,7 @@ export declare function renderWhen<State, Props>(options: {
|
|
|
120
160
|
props: Props;
|
|
121
161
|
signal: AbortSignal;
|
|
122
162
|
}): Element;
|
|
123
|
-
|
|
124
|
-
export declare const
|
|
163
|
+
/** add passed class (idempotent) to element when state returns true */
|
|
164
|
+
export declare const bindClass: (className: string, state: FunState<boolean>, signal: AbortSignal) => <E extends Element>(el: E) => E;
|
|
165
|
+
export declare const querySelectorAll: <T extends Element>(selector: string) => T[];
|
|
166
|
+
export {};
|
package/dist/esm/src/dom.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type-preserving Object.entries helper for objects with known keys
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
const entries = (obj) => Object.entries(obj);
|
|
1
6
|
/**
|
|
2
7
|
* Create an HTML element with attributes and children
|
|
3
8
|
*
|
|
@@ -42,6 +47,52 @@ attrs, children) => {
|
|
|
42
47
|
}
|
|
43
48
|
return element;
|
|
44
49
|
};
|
|
50
|
+
// eslint-disable-next-line complexity
|
|
51
|
+
export function hx(tag, options, children) {
|
|
52
|
+
if (!(options === null || options === void 0 ? void 0 : options.signal)) {
|
|
53
|
+
throw new Error("hx: signal is required");
|
|
54
|
+
}
|
|
55
|
+
const { signal, props, attrs: attrMap, on: onMap, bind } = options;
|
|
56
|
+
const element = document.createElement(tag);
|
|
57
|
+
if (props) {
|
|
58
|
+
for (const [key, value] of entries(props)) {
|
|
59
|
+
if (value == null)
|
|
60
|
+
continue;
|
|
61
|
+
element[key] = value;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (attrMap) {
|
|
65
|
+
for (const [key, value] of Object.entries(attrMap)) {
|
|
66
|
+
if (value == null)
|
|
67
|
+
continue;
|
|
68
|
+
element.setAttribute(key, String(value));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (children != null) {
|
|
72
|
+
appendChildren(children)(element);
|
|
73
|
+
}
|
|
74
|
+
if (bind) {
|
|
75
|
+
const bindElementProperty = (key, state) => {
|
|
76
|
+
bindProperty(key, state, signal)(element);
|
|
77
|
+
};
|
|
78
|
+
for (const key of Object.keys(bind)) {
|
|
79
|
+
const state = bind[key];
|
|
80
|
+
if (!state)
|
|
81
|
+
continue;
|
|
82
|
+
bindElementProperty(key, state);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (onMap) {
|
|
86
|
+
for (const [event, handler] of Object.entries(onMap)) {
|
|
87
|
+
if (!handler)
|
|
88
|
+
continue;
|
|
89
|
+
element.addEventListener(event, handler, {
|
|
90
|
+
signal,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return element;
|
|
95
|
+
}
|
|
45
96
|
/**
|
|
46
97
|
* Append children to an element, flattening arrays and converting primitives to text nodes
|
|
47
98
|
* @returns {Enhancer}
|
|
@@ -285,6 +336,10 @@ export function renderWhen(options) {
|
|
|
285
336
|
reconcile();
|
|
286
337
|
return container;
|
|
287
338
|
}
|
|
288
|
-
|
|
289
|
-
export const
|
|
339
|
+
/** add passed class (idempotent) to element when state returns true */
|
|
340
|
+
export const bindClass = (className, state, signal) => (el) => {
|
|
341
|
+
state.watch(signal, (active) => el.classList.toggle(className, active));
|
|
342
|
+
return el;
|
|
343
|
+
};
|
|
344
|
+
export const querySelectorAll = (selector) => Array.from(document.querySelectorAll(selector));
|
|
290
345
|
//# sourceMappingURL=dom.js.map
|
package/dist/esm/src/dom.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom.js","sourceRoot":"","sources":["../../../src/dom.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,CAAC,GAAG,CACf,GAAQ;AACR,8DAA8D;AAC9D,KAAkC,EAClC,QAAwC,EACZ,EAAE;IAC9B,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAE5C,qCAAqC;IACr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AM,EAAE,CAAC;YACjB,OAAO,GAAG,IAAI,CAAC;YACf,SAAS,GAAG,IAAI,CAAC;QACnB,CAAC;IACH,CAAC,CAAC;IAEF,yBAAyB;IACzB,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAE/B,8BAA8B;IAC9B,MAAM,CAAC,gBAAgB,CACrB,OAAO,EACP,GAAG,EAAE;QACH,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,EAAE,CAAC;IACrB,CAAC,EACD,EAAE,IAAI,EAAE,IAAI,EAAE,CACf,CAAC;IAEF,iBAAiB;IACjB,SAAS,EAAE,CAAC;IAEZ,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,uEAAuE;AACvE,MAAM,CAAC,MAAM,SAAS,GACpB,CAAC,SAAiB,EAAE,KAAwB,EAAE,MAAmB,EAAE,EAAE,CACrE,CAAoB,EAAK,EAAK,EAAE;IAC9B,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;IACxE,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAoB,QAAgB,EAAO,EAAE,CAC3E,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC"}
|
package/dist/esm/src/index.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export type { Component, ElementChild } from "./types";
|
|
2
|
-
export type { FunState } from "./state";
|
|
3
2
|
export type { MountedComponent } from "./mount";
|
|
4
3
|
export type { KeyedChildren } from "./dom";
|
|
5
|
-
export
|
|
6
|
-
export { h, text, attr, attrs, addClass, removeClass, toggleClass, append, on, bindProperty, bindListChildren, renderWhen, enhance, $, $$, } from "./dom";
|
|
4
|
+
export * from "./dom";
|
|
7
5
|
export { mount } from "./mount";
|
package/dist/esm/src/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// @fun-land/fun-web - Web component library for fun-land
|
|
2
|
-
export
|
|
3
|
-
export { h, text, attr, attrs, addClass, removeClass, toggleClass, append, on, bindProperty, bindListChildren, renderWhen, enhance, $, $$, } from "./dom";
|
|
2
|
+
export * from "./dom";
|
|
4
3
|
export { mount } from "./mount";
|
|
5
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,yDAAyD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,yDAAyD;AAKzD,cAAc,OAAO,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|