fibrae 0.3.0 → 0.3.2
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/atom-utils.d.ts +52 -0
- package/dist/atom-utils.js +64 -0
- package/dist/atom-utils.js.map +1 -0
- package/dist/cli/build.js +2 -2
- package/dist/cli/build.js.map +1 -1
- package/dist/cli/html.d.ts +6 -0
- package/dist/cli/html.js +20 -26
- package/dist/cli/html.js.map +1 -1
- package/dist/cli/vite-plugin.js +41 -2
- package/dist/cli/vite-plugin.js.map +1 -1
- package/dist/components.d.ts +3 -3
- package/dist/components.js +3 -1
- package/dist/components.js.map +1 -1
- package/dist/core.js +37 -10
- package/dist/core.js.map +1 -1
- package/dist/dom.d.ts +22 -3
- package/dist/dom.js +100 -5
- package/dist/dom.js.map +1 -1
- package/dist/fiber-commit.d.ts +2 -0
- package/dist/fiber-commit.js +179 -40
- package/dist/fiber-commit.js.map +1 -1
- package/dist/fiber-render.js +13 -27
- package/dist/fiber-render.js.map +1 -1
- package/dist/fiber-update.d.ts +1 -1
- package/dist/fiber-update.js +33 -12
- package/dist/fiber-update.js.map +1 -1
- package/dist/h.d.ts +65 -10
- package/dist/h.js +98 -22
- package/dist/h.js.map +1 -1
- package/dist/head.d.ts +64 -0
- package/dist/head.js +257 -0
- package/dist/head.js.map +1 -0
- package/dist/hydration-dev.d.ts +24 -0
- package/dist/hydration-dev.js +138 -0
- package/dist/hydration-dev.js.map +1 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/jsx-runtime/index.d.ts +288 -8
- package/dist/jsx-runtime/index.js +2 -0
- package/dist/jsx-runtime/index.js.map +1 -1
- package/dist/live/client.js +4 -4
- package/dist/live/client.js.map +1 -1
- package/dist/live/server.js.map +1 -1
- package/dist/live/sse-stream.js +2 -2
- package/dist/live/sse-stream.js.map +1 -1
- package/dist/mdx/index.d.ts +125 -0
- package/dist/mdx/index.js +137 -0
- package/dist/mdx/index.js.map +1 -0
- package/dist/mdx/parse.d.ts +42 -0
- package/dist/mdx/parse.js +147 -0
- package/dist/mdx/parse.js.map +1 -0
- package/dist/mdx/render.d.ts +24 -0
- package/dist/mdx/render.js +261 -0
- package/dist/mdx/render.js.map +1 -0
- package/dist/router/Form.d.ts +90 -0
- package/dist/router/Form.js +166 -0
- package/dist/router/Form.js.map +1 -0
- package/dist/router/History.d.ts +2 -2
- package/dist/router/History.js.map +1 -1
- package/dist/router/Link.d.ts +27 -32
- package/dist/router/Link.js +56 -98
- package/dist/router/Link.js.map +1 -1
- package/dist/router/Navigator.d.ts +49 -44
- package/dist/router/Navigator.js +57 -104
- package/dist/router/Navigator.js.map +1 -1
- package/dist/router/Route.d.ts +8 -4
- package/dist/router/Route.js +10 -2
- package/dist/router/Route.js.map +1 -1
- package/dist/router/Router.d.ts +10 -10
- package/dist/router/Router.js +38 -23
- package/dist/router/Router.js.map +1 -1
- package/dist/router/RouterBuilder.d.ts +69 -6
- package/dist/router/RouterBuilder.js +23 -0
- package/dist/router/RouterBuilder.js.map +1 -1
- package/dist/router/RouterOutlet.js +63 -45
- package/dist/router/RouterOutlet.js.map +1 -1
- package/dist/router/index.d.ts +10 -3
- package/dist/router/index.js +5 -2
- package/dist/router/index.js.map +1 -1
- package/dist/router/register.d.ts +37 -0
- package/dist/router/register.js +18 -0
- package/dist/router/register.js.map +1 -0
- package/dist/router/utils.d.ts +2 -2
- package/dist/runtime.d.ts +1 -1
- package/dist/server.js +7 -3
- package/dist/server.js.map +1 -1
- package/dist/shared.d.ts +36 -6
- package/dist/shared.js +12 -2
- package/dist/shared.js.map +1 -1
- package/dist/tracking.d.ts +3 -2
- package/dist/tracking.js +4 -1
- package/dist/tracking.js.map +1 -1
- package/dist/transition.d.ts +51 -0
- package/dist/transition.js +46 -0
- package/dist/transition.js.map +1 -0
- package/package.json +16 -3
|
@@ -7,9 +7,10 @@ export type JSXType = typeof Fragment | ((props: object) => VElement | Stream.St
|
|
|
7
7
|
export type PropsWithChildren<T = object> = T & {
|
|
8
8
|
children?: VChild;
|
|
9
9
|
};
|
|
10
|
-
export declare function jsx(type:
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
export declare function jsx<E, R>(type: (props: Record<string, unknown>) => Effect.Effect<VElement, E, R>, props: Record<string, unknown> | null, ...children: VChild[]): Effect.Effect<VElement, E, R>;
|
|
11
|
+
export declare function jsx<E, R>(type: (props: Record<string, unknown>) => Stream.Stream<VElement, E, R>, props: Record<string, unknown> | null, ...children: VChild[]): Stream.Stream<VElement, E, R>;
|
|
12
|
+
export declare function jsx(type: (props: Record<string, unknown>) => VNode, props: Record<string, unknown> | null, ...children: VChild[]): VElement;
|
|
13
|
+
export declare function jsx(type: string | typeof Fragment, props: Record<string, unknown> | null, ...children: VChild[]): VElement;
|
|
13
14
|
export declare const jsxs: typeof jsx;
|
|
14
15
|
export declare const jsxDEV: typeof jsx;
|
|
15
16
|
export declare const h: typeof jsx;
|
|
@@ -168,7 +169,12 @@ type NarrowedEventNames = keyof NarrowedEventHandlers<HTMLElement>;
|
|
|
168
169
|
* typed event handlers, and narrowed form-element events.
|
|
169
170
|
* Narrowed events override the generic ones to avoid union parameter types.
|
|
170
171
|
*/
|
|
171
|
-
type HTMLElementProps<E extends HTMLElement> = BaseHTMLProps & Omit<EventHandlerProps, NarrowedEventNames> & NarrowedEventHandlers<E
|
|
172
|
+
type HTMLElementProps<E extends HTMLElement> = Omit<BaseHTMLProps, "ref"> & Omit<EventHandlerProps, NarrowedEventNames> & NarrowedEventHandlers<E> & {
|
|
173
|
+
/** Ref narrowed to the specific element type */
|
|
174
|
+
ref?: ((el: E) => void) | {
|
|
175
|
+
current: E | null;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
172
178
|
/**
|
|
173
179
|
* Element-specific attribute types for elements with unique properties.
|
|
174
180
|
*/
|
|
@@ -243,6 +249,161 @@ type LabelAttrs = {
|
|
|
243
249
|
htmlFor?: string;
|
|
244
250
|
for?: string;
|
|
245
251
|
};
|
|
252
|
+
type MetaAttrs = {
|
|
253
|
+
charset?: string;
|
|
254
|
+
name?: string;
|
|
255
|
+
content?: string;
|
|
256
|
+
property?: string;
|
|
257
|
+
"http-equiv"?: string;
|
|
258
|
+
};
|
|
259
|
+
type ScriptAttrs = {
|
|
260
|
+
type?: string;
|
|
261
|
+
src?: string;
|
|
262
|
+
async?: boolean;
|
|
263
|
+
defer?: boolean;
|
|
264
|
+
crossOrigin?: string;
|
|
265
|
+
integrity?: string;
|
|
266
|
+
noModule?: boolean;
|
|
267
|
+
};
|
|
268
|
+
type LinkElementAttrs = {
|
|
269
|
+
href?: string;
|
|
270
|
+
rel?: string;
|
|
271
|
+
type?: string;
|
|
272
|
+
media?: string;
|
|
273
|
+
crossOrigin?: string;
|
|
274
|
+
integrity?: string;
|
|
275
|
+
as?: string;
|
|
276
|
+
sizes?: string;
|
|
277
|
+
};
|
|
278
|
+
type MediaAttrs = {
|
|
279
|
+
src?: string;
|
|
280
|
+
controls?: boolean;
|
|
281
|
+
autoplay?: boolean;
|
|
282
|
+
loop?: boolean;
|
|
283
|
+
muted?: boolean;
|
|
284
|
+
preload?: "none" | "metadata" | "auto" | "";
|
|
285
|
+
crossOrigin?: string;
|
|
286
|
+
};
|
|
287
|
+
type VideoAttrs = MediaAttrs & {
|
|
288
|
+
width?: string | number;
|
|
289
|
+
height?: string | number;
|
|
290
|
+
poster?: string;
|
|
291
|
+
playsInline?: boolean;
|
|
292
|
+
disablePictureInPicture?: boolean;
|
|
293
|
+
};
|
|
294
|
+
type SourceAttrs = {
|
|
295
|
+
src?: string;
|
|
296
|
+
srcset?: string;
|
|
297
|
+
type?: string;
|
|
298
|
+
media?: string;
|
|
299
|
+
sizes?: string;
|
|
300
|
+
width?: string | number;
|
|
301
|
+
height?: string | number;
|
|
302
|
+
};
|
|
303
|
+
type TrackAttrs = {
|
|
304
|
+
src?: string;
|
|
305
|
+
kind?: "subtitles" | "captions" | "descriptions" | "chapters" | "metadata";
|
|
306
|
+
srclang?: string;
|
|
307
|
+
label?: string;
|
|
308
|
+
default?: boolean;
|
|
309
|
+
};
|
|
310
|
+
type CanvasAttrs = {
|
|
311
|
+
width?: string | number;
|
|
312
|
+
height?: string | number;
|
|
313
|
+
};
|
|
314
|
+
type IframeAttrs = {
|
|
315
|
+
src?: string;
|
|
316
|
+
srcdoc?: string;
|
|
317
|
+
name?: string;
|
|
318
|
+
width?: string | number;
|
|
319
|
+
height?: string | number;
|
|
320
|
+
sandbox?: string;
|
|
321
|
+
allow?: string;
|
|
322
|
+
allowFullscreen?: boolean;
|
|
323
|
+
loading?: "lazy" | "eager";
|
|
324
|
+
referrerPolicy?: string;
|
|
325
|
+
};
|
|
326
|
+
type EmbedAttrs = {
|
|
327
|
+
src?: string;
|
|
328
|
+
type?: string;
|
|
329
|
+
width?: string | number;
|
|
330
|
+
height?: string | number;
|
|
331
|
+
};
|
|
332
|
+
type ObjectAttrs = {
|
|
333
|
+
data?: string;
|
|
334
|
+
type?: string;
|
|
335
|
+
width?: string | number;
|
|
336
|
+
height?: string | number;
|
|
337
|
+
name?: string;
|
|
338
|
+
};
|
|
339
|
+
type DialogAttrs = {
|
|
340
|
+
open?: boolean;
|
|
341
|
+
};
|
|
342
|
+
type DetailsAttrs = {
|
|
343
|
+
open?: boolean;
|
|
344
|
+
name?: string;
|
|
345
|
+
};
|
|
346
|
+
type TableAttrs = {
|
|
347
|
+
cellPadding?: string | number;
|
|
348
|
+
cellSpacing?: string | number;
|
|
349
|
+
};
|
|
350
|
+
type TdThAttrs = {
|
|
351
|
+
colSpan?: number;
|
|
352
|
+
rowSpan?: number;
|
|
353
|
+
headers?: string;
|
|
354
|
+
scope?: string;
|
|
355
|
+
};
|
|
356
|
+
type ColAttrs = {
|
|
357
|
+
span?: number;
|
|
358
|
+
};
|
|
359
|
+
type MeterAttrs = {
|
|
360
|
+
value?: number;
|
|
361
|
+
min?: number;
|
|
362
|
+
max?: number;
|
|
363
|
+
low?: number;
|
|
364
|
+
high?: number;
|
|
365
|
+
optimum?: number;
|
|
366
|
+
};
|
|
367
|
+
type ProgressAttrs = {
|
|
368
|
+
value?: number;
|
|
369
|
+
max?: number;
|
|
370
|
+
};
|
|
371
|
+
type OutputAttrs = {
|
|
372
|
+
htmlFor?: string;
|
|
373
|
+
for?: string;
|
|
374
|
+
name?: string;
|
|
375
|
+
form?: string;
|
|
376
|
+
};
|
|
377
|
+
type TimeAttrs = {
|
|
378
|
+
dateTime?: string;
|
|
379
|
+
};
|
|
380
|
+
type DataAttrs = {
|
|
381
|
+
value?: string;
|
|
382
|
+
};
|
|
383
|
+
type FieldsetAttrs = {
|
|
384
|
+
disabled?: boolean;
|
|
385
|
+
name?: string;
|
|
386
|
+
form?: string;
|
|
387
|
+
};
|
|
388
|
+
type OptgroupAttrs = {
|
|
389
|
+
disabled?: boolean;
|
|
390
|
+
label?: string;
|
|
391
|
+
};
|
|
392
|
+
type MapAttrs = {
|
|
393
|
+
name?: string;
|
|
394
|
+
};
|
|
395
|
+
type AreaAttrs = {
|
|
396
|
+
alt?: string;
|
|
397
|
+
coords?: string;
|
|
398
|
+
download?: string | boolean;
|
|
399
|
+
href?: string;
|
|
400
|
+
shape?: string;
|
|
401
|
+
target?: string;
|
|
402
|
+
rel?: string;
|
|
403
|
+
};
|
|
404
|
+
type SlotAttrs = {
|
|
405
|
+
name?: string;
|
|
406
|
+
};
|
|
246
407
|
/**
|
|
247
408
|
* Map of elements that need extra attribute types beyond the base.
|
|
248
409
|
*/
|
|
@@ -251,11 +412,39 @@ type SpecificElements = {
|
|
|
251
412
|
select: HTMLElementProps<HTMLSelectElement> & SelectAttrs;
|
|
252
413
|
textarea: HTMLElementProps<HTMLTextAreaElement> & TextareaAttrs;
|
|
253
414
|
option: HTMLElementProps<HTMLOptionElement> & OptionAttrs;
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
415
|
+
optgroup: HTMLElementProps<HTMLOptGroupElement> & OptgroupAttrs;
|
|
416
|
+
fieldset: HTMLElementProps<HTMLFieldSetElement> & FieldsetAttrs;
|
|
417
|
+
output: HTMLElementProps<HTMLOutputElement> & OutputAttrs;
|
|
257
418
|
button: HTMLElementProps<HTMLButtonElement> & ButtonAttrs;
|
|
258
419
|
label: HTMLElementProps<HTMLLabelElement> & LabelAttrs;
|
|
420
|
+
form: HTMLElementProps<HTMLFormElement> & FormAttrs;
|
|
421
|
+
a: HTMLElementProps<HTMLAnchorElement> & AnchorAttrs;
|
|
422
|
+
area: HTMLElementProps<HTMLAreaElement> & AreaAttrs;
|
|
423
|
+
audio: HTMLElementProps<HTMLAudioElement> & MediaAttrs;
|
|
424
|
+
video: HTMLElementProps<HTMLVideoElement> & VideoAttrs;
|
|
425
|
+
source: HTMLElementProps<HTMLSourceElement> & SourceAttrs;
|
|
426
|
+
track: HTMLElementProps<HTMLTrackElement> & TrackAttrs;
|
|
427
|
+
img: HTMLElementProps<HTMLImageElement> & ImgAttrs;
|
|
428
|
+
canvas: HTMLElementProps<HTMLCanvasElement> & CanvasAttrs;
|
|
429
|
+
iframe: HTMLElementProps<HTMLIFrameElement> & IframeAttrs;
|
|
430
|
+
embed: HTMLElementProps<HTMLEmbedElement> & EmbedAttrs;
|
|
431
|
+
object: HTMLElementProps<HTMLObjectElement> & ObjectAttrs;
|
|
432
|
+
meta: HTMLElementProps<HTMLMetaElement> & MetaAttrs;
|
|
433
|
+
script: HTMLElementProps<HTMLScriptElement> & ScriptAttrs;
|
|
434
|
+
link: HTMLElementProps<HTMLLinkElement> & LinkElementAttrs;
|
|
435
|
+
dialog: HTMLElementProps<HTMLDialogElement> & DialogAttrs;
|
|
436
|
+
details: HTMLElementProps<HTMLDetailsElement> & DetailsAttrs;
|
|
437
|
+
slot: HTMLElementProps<HTMLSlotElement> & SlotAttrs;
|
|
438
|
+
table: HTMLElementProps<HTMLTableElement> & TableAttrs;
|
|
439
|
+
td: HTMLElementProps<HTMLTableCellElement> & TdThAttrs;
|
|
440
|
+
th: HTMLElementProps<HTMLTableCellElement> & TdThAttrs;
|
|
441
|
+
col: HTMLElementProps<HTMLTableColElement> & ColAttrs;
|
|
442
|
+
colgroup: HTMLElementProps<HTMLTableColElement> & ColAttrs;
|
|
443
|
+
meter: HTMLElementProps<HTMLMeterElement> & MeterAttrs;
|
|
444
|
+
progress: HTMLElementProps<HTMLProgressElement> & ProgressAttrs;
|
|
445
|
+
time: HTMLElementProps<HTMLTimeElement> & TimeAttrs;
|
|
446
|
+
data: HTMLElementProps<HTMLDataElement> & DataAttrs;
|
|
447
|
+
map: HTMLElementProps<HTMLMapElement> & MapAttrs;
|
|
259
448
|
};
|
|
260
449
|
/**
|
|
261
450
|
* All remaining HTML elements get base props + typed events.
|
|
@@ -264,11 +453,102 @@ type SpecificElements = {
|
|
|
264
453
|
type GenericElements = {
|
|
265
454
|
[K in Exclude<keyof HTMLElementTagNameMap, keyof SpecificElements>]: HTMLElementProps<HTMLElementTagNameMap[K]>;
|
|
266
455
|
};
|
|
456
|
+
/**
|
|
457
|
+
* Common SVG presentation attributes shared across all SVG elements.
|
|
458
|
+
* Covers the most-used attributes; exotic ones fall through via [key: string].
|
|
459
|
+
*/
|
|
460
|
+
type BaseSVGProps = {
|
|
461
|
+
key?: string | number;
|
|
462
|
+
ref?: ((el: SVGElement) => void) | {
|
|
463
|
+
current: SVGElement | null;
|
|
464
|
+
};
|
|
465
|
+
children?: VChild;
|
|
466
|
+
style?: string | Record<string, string | number>;
|
|
467
|
+
class?: string;
|
|
468
|
+
className?: string;
|
|
469
|
+
id?: string;
|
|
470
|
+
lang?: string;
|
|
471
|
+
tabIndex?: number;
|
|
472
|
+
fill?: string;
|
|
473
|
+
stroke?: string;
|
|
474
|
+
strokeWidth?: string | number;
|
|
475
|
+
strokeLinecap?: "butt" | "round" | "square";
|
|
476
|
+
strokeLinejoin?: "miter" | "round" | "bevel";
|
|
477
|
+
strokeDasharray?: string;
|
|
478
|
+
strokeDashoffset?: string | number;
|
|
479
|
+
strokeOpacity?: string | number;
|
|
480
|
+
fillOpacity?: string | number;
|
|
481
|
+
fillRule?: "nonzero" | "evenodd";
|
|
482
|
+
clipRule?: "nonzero" | "evenodd";
|
|
483
|
+
opacity?: string | number;
|
|
484
|
+
transform?: string;
|
|
485
|
+
viewBox?: string;
|
|
486
|
+
xmlns?: string;
|
|
487
|
+
width?: string | number;
|
|
488
|
+
height?: string | number;
|
|
489
|
+
x?: string | number;
|
|
490
|
+
y?: string | number;
|
|
491
|
+
cx?: string | number;
|
|
492
|
+
cy?: string | number;
|
|
493
|
+
r?: string | number;
|
|
494
|
+
rx?: string | number;
|
|
495
|
+
ry?: string | number;
|
|
496
|
+
x1?: string | number;
|
|
497
|
+
y1?: string | number;
|
|
498
|
+
x2?: string | number;
|
|
499
|
+
y2?: string | number;
|
|
500
|
+
d?: string;
|
|
501
|
+
pathLength?: string | number;
|
|
502
|
+
markerStart?: string;
|
|
503
|
+
markerMid?: string;
|
|
504
|
+
markerEnd?: string;
|
|
505
|
+
gradientUnits?: string;
|
|
506
|
+
gradientTransform?: string;
|
|
507
|
+
spreadMethod?: string;
|
|
508
|
+
offset?: string | number;
|
|
509
|
+
stopColor?: string;
|
|
510
|
+
stopOpacity?: string | number;
|
|
511
|
+
textAnchor?: string;
|
|
512
|
+
dominantBaseline?: string;
|
|
513
|
+
dx?: string | number;
|
|
514
|
+
dy?: string | number;
|
|
515
|
+
fontSize?: string | number;
|
|
516
|
+
fontFamily?: string;
|
|
517
|
+
fontWeight?: string | number;
|
|
518
|
+
clipPath?: string;
|
|
519
|
+
mask?: string;
|
|
520
|
+
filter?: string;
|
|
521
|
+
preserveAspectRatio?: string;
|
|
522
|
+
href?: string;
|
|
523
|
+
xlinkHref?: string;
|
|
524
|
+
points?: string;
|
|
525
|
+
[key: `data-${string}`]: unknown;
|
|
526
|
+
[key: `aria-${string}`]: unknown;
|
|
527
|
+
};
|
|
528
|
+
/**
|
|
529
|
+
* SVG element props = common SVG attributes + event handlers.
|
|
530
|
+
* All SVG elements share the same prop type — no per-element specialization needed.
|
|
531
|
+
*/
|
|
532
|
+
type SVGElementProps<E extends SVGElement = SVGElement> = Omit<BaseSVGProps, "ref"> & EventHandlerProps & {
|
|
533
|
+
/** Ref narrowed to the specific SVG element type */
|
|
534
|
+
ref?: ((el: E) => void) | {
|
|
535
|
+
current: E | null;
|
|
536
|
+
};
|
|
537
|
+
};
|
|
538
|
+
/**
|
|
539
|
+
* SVG elements derived from SVGElementTagNameMap.
|
|
540
|
+
* Excludes keys that overlap with HTMLElementTagNameMap (a, script, style, title)
|
|
541
|
+
* since those are already typed as HTML elements and the HTML versions are what
|
|
542
|
+
* JSX users expect in practice.
|
|
543
|
+
*/
|
|
544
|
+
type SVGElements = {
|
|
545
|
+
[K in Exclude<keyof SVGElementTagNameMap, keyof HTMLElementTagNameMap>]: SVGElementProps<SVGElementTagNameMap[K]>;
|
|
546
|
+
};
|
|
267
547
|
declare global {
|
|
268
548
|
namespace JSX {
|
|
269
549
|
type Element = VElement;
|
|
270
550
|
type ElementType = keyof IntrinsicElements | ((props: any) => VNode);
|
|
271
|
-
interface IntrinsicElements extends SpecificElements, GenericElements {
|
|
551
|
+
interface IntrinsicElements extends SpecificElements, GenericElements, SVGElements {
|
|
272
552
|
}
|
|
273
553
|
interface IntrinsicAttributes {
|
|
274
554
|
key?: string | number;
|
|
@@ -26,6 +26,8 @@ function normalizeChild(child) {
|
|
|
26
26
|
// Assume it's an already properly shaped VElement
|
|
27
27
|
return child;
|
|
28
28
|
}
|
|
29
|
+
// --- Implementation (return type is VElement at runtime; overloads provide
|
|
30
|
+
// type-level Effect/Stream propagation for the checker) ---
|
|
29
31
|
export function jsx(type, props, ...children) {
|
|
30
32
|
const normalizedProps = props ?? {};
|
|
31
33
|
let finalChildren = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/jsx-runtime/index.ts"],"names":[],"mappings":"AAIA,uCAAuC;AACvC,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAm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ode error").pipe(Effect.annotateLogs({ channel: channel.name, error: String(result.left) })));
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
|
-
es.
|
|
52
|
+
es.addEventListener("error", () => {
|
|
53
53
|
run(Effect.logWarning("LiveSync connection error").pipe(Effect.annotateLogs("channel", channel.name)));
|
|
54
|
-
};
|
|
54
|
+
});
|
|
55
55
|
yield* Scope.addFinalizer(scope, Effect.sync(() => es.close()));
|
|
56
56
|
});
|
|
57
57
|
/**
|
|
@@ -82,9 +82,9 @@ export const connectGroup = (channels, options) => Effect.gen(function* () {
|
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
|
-
es.
|
|
85
|
+
es.addEventListener("error", () => {
|
|
86
86
|
run(Effect.logWarning("LiveSync connection error").pipe(Effect.annotateLogs("channels", channels.map((c) => c.name).join(","))));
|
|
87
|
-
};
|
|
87
|
+
});
|
|
88
88
|
yield* Scope.addFinalizer(scope, Effect.sync(() => es.close()));
|
|
89
89
|
});
|
|
90
90
|
//# sourceMappingURL=client.js.map
|
package/dist/live/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/live/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAe9C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CACrB,OAA0B,EAC1B,OAAuB,EACiD,EAAE,CAC1E,MAAM,CA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AAC;IAExC,qFAAqF;IACrF,OAAO,kBAAkB,CAAC,MAAM,CAAC,SAAgB,EAAE;QACjD,WAAW,EAAE,mBAAmB;QAChC,OAAO,EAAE,WAAW;KACrB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/live/sse-stream.js
CHANGED
|
@@ -21,9 +21,9 @@ export const sseStream = (options) => {
|
|
|
21
21
|
// Decode errors are silently skipped — atom stays at previous value
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
es.
|
|
24
|
+
es.addEventListener("error", () => {
|
|
25
25
|
// EventSource auto-reconnects; don't end the stream
|
|
26
|
-
};
|
|
26
|
+
});
|
|
27
27
|
return Effect.sync(() => es.close());
|
|
28
28
|
});
|
|
29
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sse-stream.js","sourceRoot":"","sources":["../../src/live/sse-stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAO,OAK/B,EAAkC,EAAE;IACnC,MAAM,MAAM,GAAG,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAE1E,OAAO,MAAM,CAAC,KAAK,CAAI,CAAC,IAAI,EAAE,EAAE;QAC9B,MAAM,EAAE,GAAG,IAAI,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE;YACtC,eAAe,EAAE,OAAO,CAAC,eAAe,IAAI,KAAK;SAClD,CAAC,CAAC;QAEH,EAAE,CAAC,gBAAgB,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAe,EAAE,EAAE;YACrD,IAAI,CAAC;gBACH,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAA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@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Layer from "effect/Layer";
|
|
3
|
+
import * as Context from "effect/Context";
|
|
4
|
+
import type { VElement } from "../shared.js";
|
|
5
|
+
import type { MdxComponents, MdxHighlighterShape } from "./render.js";
|
|
6
|
+
import type { MdxProcessorShape, ProcessorConfig } from "./parse.js";
|
|
7
|
+
export { parseMdx, createProcessor, slugify, getTextContent } from "./parse.js";
|
|
8
|
+
export type { ParsedMdx, MdxHeading, MdxProcessorShape, Plugin, PluginTuple, ProcessorConfig, } from "./parse.js";
|
|
9
|
+
export { renderMdast, renderHast } from "./render.js";
|
|
10
|
+
export type { MdxComponents, MdxHighlighterShape } from "./render.js";
|
|
11
|
+
declare const MdxProcessor_base: Context.TagClass<MdxProcessor, "fibrae/MdxProcessor", MdxProcessorShape>;
|
|
12
|
+
/**
|
|
13
|
+
* Configurable markdown processor service.
|
|
14
|
+
*
|
|
15
|
+
* Default: remark-parse + gfm + frontmatter.
|
|
16
|
+
* Use `MdxProcessor.make()` with custom remark/rehype plugins.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* // Default processor
|
|
21
|
+
* const layer = MdxProcessor.Default
|
|
22
|
+
*
|
|
23
|
+
* // With extra remark plugins (bare function or [plugin, options] tuple)
|
|
24
|
+
* const layer = MdxProcessor.make({ remarkPlugins: [remarkMath] })
|
|
25
|
+
*
|
|
26
|
+
* // With rehype plugins (auto-bridges MDAST → HAST via dynamic import)
|
|
27
|
+
* const layer = MdxProcessor.make({
|
|
28
|
+
* rehypePlugins: [rehypeKatex, [rehypeHighlight, { prefix: "hl-" }]],
|
|
29
|
+
* })
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare class MdxProcessor extends MdxProcessor_base {
|
|
33
|
+
/** Default processor: remark-parse + gfm + frontmatter */
|
|
34
|
+
static readonly Default: Layer.Layer<MdxProcessor, never, never>;
|
|
35
|
+
/** Create a processor with custom remark/rehype plugins */
|
|
36
|
+
static readonly make: (config: ProcessorConfig) => Layer.Layer<MdxProcessor, never, never>;
|
|
37
|
+
}
|
|
38
|
+
declare const MdxHighlighter_base: Context.TagClass<MdxHighlighter, "fibrae/MdxHighlighter", MdxHighlighterShape>;
|
|
39
|
+
/**
|
|
40
|
+
* Optional BYO code highlighter service.
|
|
41
|
+
*
|
|
42
|
+
* When provided, code blocks use this instead of plain `<pre><code>`.
|
|
43
|
+
* User component overrides (`components.pre`/`components.code`) take priority.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
* import { highlightElement } from "my-highlighter"
|
|
48
|
+
*
|
|
49
|
+
* const layer = MdxHighlighter.make((code, lang) =>
|
|
50
|
+
* <pre class={`language-${lang}`}>
|
|
51
|
+
* <code innerHTML={highlightElement(code, lang)} />
|
|
52
|
+
* </pre>
|
|
53
|
+
* )
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare class MdxHighlighter extends MdxHighlighter_base {
|
|
57
|
+
/** Create a highlighter from a highlight function */
|
|
58
|
+
static readonly make: (highlight: (code: string, lang: string, meta?: string | undefined) => Effect.Effect<VElement, unknown, unknown> | VElement) => Layer.Layer<MdxHighlighter, never, never>;
|
|
59
|
+
}
|
|
60
|
+
declare const MDXComponents_base: Context.TagClass<MDXComponents, "fibrae/MDXComponents", Partial<Record<string, (props: Record<string, unknown>) => Effect.Effect<VElement, unknown, unknown> | VElement>>>;
|
|
61
|
+
/**
|
|
62
|
+
* Optional service for injecting default component overrides into MDX rendering.
|
|
63
|
+
*
|
|
64
|
+
* Provides app-wide component mappings (e.g. styled headings, custom links)
|
|
65
|
+
* without passing them as props to every `<MDX />` instance. Props-level
|
|
66
|
+
* `components` take priority over the service (more specific wins).
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```tsx
|
|
70
|
+
* // Define app-wide overrides as a Layer
|
|
71
|
+
* const MdxComponentsLive = MDXComponents.make({
|
|
72
|
+
* h1: ({ children, ...props }) => <h1 class="text-4xl" {...props}>{children}</h1>,
|
|
73
|
+
* a: ({ href, children }) => <Link href={href}>{children}</Link>,
|
|
74
|
+
* code: ({ children, ...props }) => <CodeBlock {...props}>{children}</CodeBlock>,
|
|
75
|
+
* })
|
|
76
|
+
*
|
|
77
|
+
* // Provide to your app — all <MDX /> instances pick up these overrides
|
|
78
|
+
* render(<App />, root).pipe(Effect.provide(MdxComponentsLive))
|
|
79
|
+
*
|
|
80
|
+
* // Per-instance props still override the service
|
|
81
|
+
* <MDX content={md} components={{ h1: ({ children }) => <h1 class="custom">{children}</h1> }} />
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
export declare class MDXComponents extends MDXComponents_base {
|
|
85
|
+
/** Create a Layer providing component overrides */
|
|
86
|
+
static readonly make: (components: Partial<Record<string, (props: Record<string, unknown>) => Effect.Effect<VElement, unknown, unknown> | VElement>>) => Layer.Layer<MDXComponents, never, never>;
|
|
87
|
+
}
|
|
88
|
+
export interface MDXProps {
|
|
89
|
+
readonly content: string;
|
|
90
|
+
readonly components?: MdxComponents;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Render markdown content as fibrae VElements.
|
|
94
|
+
*
|
|
95
|
+
* All three services (`MdxProcessor`, `MdxHighlighter`, `MDXComponents`) are
|
|
96
|
+
* optional. Without them, uses default processor, no highlighting, and no
|
|
97
|
+
* component overrides.
|
|
98
|
+
*
|
|
99
|
+
* Component resolution order (most specific wins):
|
|
100
|
+
* 1. Props-level `components` passed to this instance
|
|
101
|
+
* 2. `MDXComponents` service (app-wide defaults)
|
|
102
|
+
* 3. Native HTML element
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```tsx
|
|
106
|
+
* // Simplest usage — no services needed
|
|
107
|
+
* <MDX content={markdownString} />
|
|
108
|
+
*
|
|
109
|
+
* // With component overrides via props
|
|
110
|
+
* <MDX content={markdownString} components={{
|
|
111
|
+
* h1: ({ children, ...props }) => <h1 class="text-4xl" {...props}>{children}</h1>,
|
|
112
|
+
* a: ({ href, children }) => <Link href={href}>{children}</Link>,
|
|
113
|
+
* }} />
|
|
114
|
+
*
|
|
115
|
+
* // With app-wide overrides via service
|
|
116
|
+
* const MdxLive = Layer.mergeAll(
|
|
117
|
+
* MDXComponents.make({ h1: MyHeading, a: MyLink }),
|
|
118
|
+
* MdxHighlighter.make((code, lang) => <CodeBlock code={code} lang={lang} />),
|
|
119
|
+
* )
|
|
120
|
+
*
|
|
121
|
+
* // Provide to your app
|
|
122
|
+
* render(<App />, root).pipe(Effect.provide(MdxLive))
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
export declare const MDX: ({ content, components }: MDXProps) => Effect.Effect<VElement, unknown, unknown>;
|