@atom.io/spa 0.0.1 → 0.0.3

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.
Files changed (124) hide show
  1. package/README.md +254 -6
  2. package/README.mdx +83 -1
  3. package/dist/astro-application.d.ts +1 -1
  4. package/dist/astro-application.js +2 -2
  5. package/dist/astro-application.js.map +1 -1
  6. package/dist/astro-client.d.ts +1 -1
  7. package/dist/astro-client.js +6 -3
  8. package/dist/astro-client.js.map +1 -1
  9. package/dist/astro-server.js +2 -1
  10. package/dist/astro-server.js.map +1 -1
  11. package/dist/astro-shared-BT45auwR.js.map +1 -1
  12. package/dist/{astro-shared-DkZaqX7L.d.ts → astro-shared-BkWvVZWZ.d.ts} +4 -2
  13. package/dist/astro-shared-BkWvVZWZ.d.ts.map +1 -0
  14. package/dist/astro.d.ts +1 -1
  15. package/dist/astro.js +1 -1
  16. package/dist/capabilities-BkQ2i0vV.js +63 -0
  17. package/dist/capabilities-BkQ2i0vV.js.map +1 -0
  18. package/dist/capabilities-CFP-HIuY.d.ts +115 -0
  19. package/dist/capabilities-CFP-HIuY.d.ts.map +1 -0
  20. package/dist/client.min.js +1 -1
  21. package/dist/{core-Dvqm7w2y.js → core-DCmqLZQP.js} +23 -4
  22. package/dist/core-DCmqLZQP.js.map +1 -0
  23. package/dist/development/astro-application.js +2 -2
  24. package/dist/development/astro-application.js.map +1 -1
  25. package/dist/development/astro-client.js +6 -3
  26. package/dist/development/astro-client.js.map +1 -1
  27. package/dist/development/astro-server.js +2 -1
  28. package/dist/development/astro-server.js.map +1 -1
  29. package/dist/development/astro-shared-BT45auwR.js.map +1 -1
  30. package/dist/development/astro.js +1 -1
  31. package/dist/development/capabilities-BkQ2i0vV.js +63 -0
  32. package/dist/development/capabilities-BkQ2i0vV.js.map +1 -0
  33. package/dist/development/{core-DB3sQz4h.js → core-p9vciX9C.js} +23 -4
  34. package/dist/development/core-p9vciX9C.js.map +1 -0
  35. package/dist/development/{dom-D9cY6l1R.js → dom-Ci1XvbVJ.js} +21 -7
  36. package/dist/development/dom-Ci1XvbVJ.js.map +1 -0
  37. package/dist/development/index.js +3 -38
  38. package/dist/development/jsx-runtime.js.map +1 -1
  39. package/dist/development/konva.js +143 -0
  40. package/dist/development/konva.js.map +1 -0
  41. package/dist/development/motion.js +601 -0
  42. package/dist/development/motion.js.map +1 -0
  43. package/dist/development/renderer.js +190 -0
  44. package/dist/development/renderer.js.map +1 -0
  45. package/dist/development/server.js +4 -2
  46. package/dist/development/server.js.map +1 -1
  47. package/dist/development/src-DG0xjuS5.js +38 -0
  48. package/dist/development/src-DG0xjuS5.js.map +1 -0
  49. package/dist/development/three.js +452 -0
  50. package/dist/development/three.js.map +1 -0
  51. package/dist/development/vite-CSHoxzXU.js +240 -0
  52. package/dist/development/vite-CSHoxzXU.js.map +1 -0
  53. package/dist/development/vite.js +1 -1
  54. package/dist/{dom-BR9o9wZW.js → dom-dHQM0O7Q.js} +21 -7
  55. package/dist/dom-dHQM0O7Q.js.map +1 -0
  56. package/dist/index-CJJXcKaw.d.ts +24 -0
  57. package/dist/index-CJJXcKaw.d.ts.map +1 -0
  58. package/dist/index.d.ts +4 -24
  59. package/dist/index.js +3 -38
  60. package/dist/{jsx-runtime-BzGV18VO.d.ts → jsx-runtime-CREZYKDC.d.ts} +6 -4
  61. package/dist/jsx-runtime-CREZYKDC.d.ts.map +1 -0
  62. package/dist/jsx-runtime.d.ts +2 -2
  63. package/dist/jsx-runtime.js.map +1 -1
  64. package/dist/konva.d.ts +32 -0
  65. package/dist/konva.d.ts.map +1 -0
  66. package/dist/konva.js +143 -0
  67. package/dist/konva.js.map +1 -0
  68. package/dist/motion.d.ts +45 -0
  69. package/dist/motion.d.ts.map +1 -0
  70. package/dist/motion.js +601 -0
  71. package/dist/motion.js.map +1 -0
  72. package/dist/renderer.d.ts +24 -0
  73. package/dist/renderer.d.ts.map +1 -0
  74. package/dist/renderer.js +190 -0
  75. package/dist/renderer.js.map +1 -0
  76. package/dist/server.d.ts +1 -1
  77. package/dist/server.d.ts.map +1 -1
  78. package/dist/server.js +4 -2
  79. package/dist/server.js.map +1 -1
  80. package/dist/size.json +16 -16
  81. package/dist/src-DCQa6qxs.js +38 -0
  82. package/dist/src-DCQa6qxs.js.map +1 -0
  83. package/dist/three.d.ts +110 -0
  84. package/dist/three.d.ts.map +1 -0
  85. package/dist/three.js +452 -0
  86. package/dist/three.js.map +1 -0
  87. package/dist/vite-CSHoxzXU.js +240 -0
  88. package/dist/vite-CSHoxzXU.js.map +1 -0
  89. package/dist/vite.js +1 -1
  90. package/package.json +62 -15
  91. package/src/astro-application.ts +2 -2
  92. package/src/astro-client.ts +1 -0
  93. package/src/astro-server.ts +1 -0
  94. package/src/astro-shared.ts +3 -0
  95. package/src/capabilities.ts +107 -0
  96. package/src/compiler.ts +251 -178
  97. package/src/core.ts +38 -2
  98. package/src/dom.ts +38 -4
  99. package/src/index.ts +5 -0
  100. package/src/jsx-runtime.ts +4 -0
  101. package/src/jsx-types.d.ts +3 -1
  102. package/src/konva.ts +186 -0
  103. package/src/motion-tween.ts +106 -0
  104. package/src/motion.ts +519 -0
  105. package/src/presence.ts +324 -0
  106. package/src/renderer.ts +278 -0
  107. package/src/server.ts +3 -0
  108. package/src/three-events.ts +342 -0
  109. package/src/three.ts +373 -0
  110. package/dist/astro-shared-DkZaqX7L.d.ts.map +0 -1
  111. package/dist/core-BhiA9fFi.d.ts +0 -44
  112. package/dist/core-BhiA9fFi.d.ts.map +0 -1
  113. package/dist/core-Dvqm7w2y.js.map +0 -1
  114. package/dist/development/core-DB3sQz4h.js.map +0 -1
  115. package/dist/development/dom-D9cY6l1R.js.map +0 -1
  116. package/dist/development/index.js.map +0 -1
  117. package/dist/development/vite-CQchIQ_-.js +0 -126
  118. package/dist/development/vite-CQchIQ_-.js.map +0 -1
  119. package/dist/dom-BR9o9wZW.js.map +0 -1
  120. package/dist/index.d.ts.map +0 -1
  121. package/dist/index.js.map +0 -1
  122. package/dist/jsx-runtime-BzGV18VO.d.ts.map +0 -1
  123. package/dist/vite-CQchIQ_-.js +0 -126
  124. package/dist/vite-CQchIQ_-.js.map +0 -1
package/README.md CHANGED
@@ -358,7 +358,7 @@ The checked Astro fixture demonstrates default/named slots and custom independen
358
358
 
359
359
  The build audits every browser export, including the JSX runtime, from the built JavaScript. Atom.io is an external peer in the incremental measurement. Compiler, server, and integration code have separate entrypoints. The report also includes the complete client plus atom.io, the Astro client entrypoint, and the installed Preact version under the same bundling/minification settings. These are full exported surfaces, not equivalent application benchmarks.
360
360
 
361
- The hard budget is under 3,400 bytes of ordinary level-9 gzip for the complete client export surface. Tsdown builds the package JavaScript and declarations, with separate production and development outputs that each share their runtime across entrypoints. The size audit then bundles the built exports with esbuild, minifies with Oxc, and measures compression using Node's gzip and Brotli implementations. The spa client measures 3,358 bytes with gzip. Actual application bundles add atom.io and compiler-generated application code.
361
+ The hard budget is under 4,100 bytes of ordinary level-9 gzip for the complete client export surface. Tsdown builds the package JavaScript and declarations, with separate production and development outputs that each share their runtime across entrypoints. The size audit then bundles the built exports with esbuild, minifies with Oxc, and measures compression using Node's gzip and Brotli implementations. The complete client export surface measures approximately 4.0 kB with gzip; dist/size.json records the exact build measurements. Actual application bundles add atom.io and compiler-generated application code.
362
362
 
363
363
  Build output includes the minified audit entrypoint and machine-readable dist/size.json. These audit files are a bundled measurement; use the package exports in applications so the bundler preserves one runtime instance across entrypoints. Source tests exercise development behavior; the production test executes the audited minified artifact. Chromium checks exercise the actual Astro build, island isolation, hydration, keyed identity, focus/selection, SVG namespaces, and teardown. A fresh-cache Astro development check also covers mount hooks, shared state, and ClientRouter navigation.
364
364
 
@@ -368,6 +368,7 @@ pnpm --filter @atom.io/spa cov
368
368
  pnpm --filter @atom.io/spa-devtools cov
369
369
  pnpm exec turbo run test:breakage:peers --filter=@atom.io/spa --filter=@atom.io/spa-devtools
370
370
  pnpm --filter @atom.io/spa test:production
371
+ pnpm --filter @atom.io/spa test:optional-peers
371
372
  pnpm --filter @atom.io/spa exec playwright install chromium
372
373
  pnpm --filter @atom.io/spa test:browser
373
374
  pnpm --filter @atom.io/spa size
@@ -389,14 +390,261 @@ Sizes are exact minified and level-9 gzip JavaScript byte counts. Declarations,
389
390
 
390
391
  | Recipe | Entry | Minified JS | Gzip JS |
391
392
  | -------------------------------- | --------------------------------- | ----------: | -------: |
392
- | Family app with refs and history | `tonnage-recipes/family-app.ts` | 61,387 B | 18,140 B |
393
- | Async interactive client app | `tonnage-recipes/async-app.ts` | 39,798 B | 12,327 B |
394
- | Interactive client app | `tonnage-recipes/client-app.ts` | 39,460 B | 12,178 B |
395
- | Hydrated interactive app | `tonnage-recipes/hydrated-app.ts` | 39,461 B | 12,178 B |
396
- | Interactive Astro island | `tonnage-recipes/astro-island.ts` | 45,808 B | 14,152 B |
393
+ | Family app with refs and history | `tonnage-recipes/family-app.ts` | 63,717 B | 18,894 B |
394
+ | Async interactive client app | `tonnage-recipes/async-app.ts` | 42,121 B | 13,134 B |
395
+ | Interactive client app | `tonnage-recipes/client-app.ts` | 41,783 B | 12,981 B |
396
+ | Hydrated interactive app | `tonnage-recipes/hydrated-app.ts` | 41,784 B | 12,981 B |
397
+ | Interactive Astro island | `tonnage-recipes/astro-island.ts` | 48,152 B | 14,973 B |
397
398
 
398
399
  Report maintained with [tonnage](https://github.com/jeremybanka/tonnage).
399
400
 
400
401
  ## License
401
402
 
402
403
  MPL-2.0 or later. See [LICENSE](./LICENSE).
404
+
405
+ ## Optional graphics and motion
406
+
407
+ SPA includes Konva, Three.js, and Motion integrations behind separate entrypoints. Install only the engines you use. Konva, three, @types/three, and motion are optional peers; the main runtime and JSX declarations work without them installed. Importing the base entrypoint does not load any animation or graphics engine, and each integration's bundle excludes the other engines. These boundaries are verified with isolated consumer and bundle checks.
408
+
409
+ ### Konva
410
+
411
+ Import Stage, Layer, Group, Rect, Circle, Ellipse, Line, Text, Image, Path, Star, and Transformer from @atom.io/spa/konva. Stage renders a DOM container and creates its native stage after browser mounting. Compiled atom reads update native attributes; keyed children preserve node identity. Native configuration attributes and onClick, onPointerDown, onDragMove, and onDragEnd handlers are supported. Refs receive native nodes and null on cleanup. Removal destroys owned nodes and listeners.
412
+
413
+ ```tsx
414
+ import type { VNode } from "@atom.io/spa"
415
+ import { useSetter, useValue } from "@atom.io/spa"
416
+ import { Circle, Layer, Stage } from "@atom.io/spa/konva"
417
+ import { atom } from "atom.io"
418
+
419
+ const pointAtom = atom<{ x: number; y: number }>({
420
+ key: `point`,
421
+ default: { x: 100, y: 100 },
422
+ })
423
+ export function Editor(): VNode {
424
+ const point = useValue(pointAtom)
425
+ const setPoint = useSetter(pointAtom)
426
+ return (
427
+ <Stage width={800} height={600}>
428
+ <Layer>
429
+ <Circle
430
+ x={point().x}
431
+ y={point().y}
432
+ radius={25}
433
+ fill="coral"
434
+ draggable
435
+ onDragEnd={(event) => {
436
+ setPoint({ x: event.target.x(), y: event.target.y() })
437
+ }}
438
+ />
439
+ </Layer>
440
+ </Stage>
441
+ )
442
+ }
443
+
444
+ ```
445
+
446
+ Konva owns hit testing, dragging, and draw batching. Write drag results back into atoms to keep document state synchronized. The exported konvaRenderer can also render into a borrowed container dedicated to its scene children.
447
+
448
+ ### Three.js
449
+
450
+ Import Canvas, Group, Mesh, PerspectiveCamera, AmbientLight, DirectionalLight, BoxGeometry, SphereGeometry, PlaneGeometry, MeshStandardMaterial, MeshBasicMaterial, and MeshNormalMaterial from @atom.io/spa/three. Canvas creates a WebGL renderer after browser mounting. Geometry and material children attach to their Mesh, with one of each supported. Position and rotation accept three-number tuples; scale also accepts a scalar.
451
+
452
+ ```tsx
453
+ import type { VNode } from "@atom.io/spa"
454
+ import { useValue } from "@atom.io/spa"
455
+ import {
456
+ AmbientLight,
457
+ BoxGeometry,
458
+ Canvas,
459
+ DirectionalLight,
460
+ Mesh,
461
+ MeshStandardMaterial,
462
+ } from "@atom.io/spa/three"
463
+ import { atom } from "atom.io"
464
+
465
+ const colorAtom = atom<string>({ key: `color`, default: `coral` })
466
+ export function Scene(): VNode {
467
+ const color = useValue(colorAtom)
468
+ return (
469
+ <Canvas width={800} height={600}>
470
+ <AmbientLight intensity={0.5} />
471
+ <DirectionalLight position={[3, 3, 3]} />
472
+ <Mesh rotation={[0.3, 0.5, 0]}>
473
+ <BoxGeometry args={[1, 1, 1]} />
474
+ <MeshStandardMaterial color={color()} />
475
+ </Mesh>
476
+ </Canvas>
477
+ )
478
+ }
479
+
480
+ ```
481
+
482
+ Constructor args are fixed for an instance. To change them, replace the resource with a new key in a reactive child collection. Refs expose native objects. Owned geometries and materials are disposed on removal; textures passed through material properties remain borrowed. Canvas stops drawing and disposes its renderer on removal. The exported threeRenderer renders into a borrowed parent dedicated to its children without creating a WebGL renderer.
483
+
484
+ Canvas defaults to a perspective camera at z = 5. Its optional camera prop borrows an external camera; a PerspectiveCamera child does not automatically become active. Width and height update the renderer and default camera. Canvas renders continuously and accepts an onFrame callback with scene, camera, renderer, delta seconds, and timestamp seconds. Controls, asset loading, and drawing on demand are outside this initial API.
485
+
486
+ ### Three.js pointer events
487
+
488
+ Mesh and group components accept onPointerDown, onPointerUp, onPointerMove, onPointerEnter, onPointerLeave, onPointerOver, onPointerOut, onPointerCancel, and onClick handlers. Canvas converts CSS pointer coordinates into a ray through the current camera, updates world matrices, and picks the nearest visible object on the camera's layers. That object occludes objects behind it even when it has no handlers. Three.js material sidedness controls which surfaces can be picked.
489
+
490
+ Events bubble from the picked object through its scene ancestors; stopPropagation stops ancestor delivery. Enter and leave notifications describe each ancestor's hover boundary without repeating when moving between its children. Hover is tracked per pointer and re-evaluated each frame, so moving objects and cameras update hover even when the pointer stays still. Hidden ancestry and hidden materials are excluded.
491
+
492
+ A ThreePointerEvent exposes nativeEvent, target (the receiving leaf or captured object), currentTarget (the handler's object), intersection, ray, pointerId, button, buttons, clientX, clientY, preventDefault, stopPropagation, and setPointerCapture/releasePointerCapture/hasPointerCapture methods scoped to that handler's object. Capturing on a group retargets subsequent events to that group. Off-object captured events retain the capture's last intersection; use the current ray for drag-plane calculations. A primary-button click is emitted only when press and release pick the same leaf.
493
+
494
+ Canvas retains native pointer delivery during a press. Releasing outside a pressed object cancels it unless a scene object explicitly captured the pointer; captured objects still receive the release outside the canvas. Pointer cancellation, browser capture loss, subtree removal, and Canvas disposal clear interaction state and release native capture. Cleanup continues if removal callbacks fail. Borrowed scenes can use createThreeEvents directly, call update after changing the scene, remove to release a subtree's interaction state, and dispose when the surface is released.
495
+
496
+ ### Declarative motion capabilities
497
+
498
+ Import motionCapability from @atom.io/spa/motion and register it explicitly in render or hydrate options. Importing that entrypoint also supplies JSX type augmentation. Registration belongs to one root, is inherited by its scene subtrees, and never modifies a global registry. Astro islands can set their component's capabilities property to the same array; the integration supplies it to both server rendering and browser hydration.
499
+
500
+ ```tsx
501
+ import { render } from "@atom.io/spa"
502
+ import { motionCapability } from "@atom.io/spa/motion"
503
+
504
+ import { MotionPanel } from "./motion.spa.tsx"
505
+
506
+ render(() => <MotionPanel />, document.getElementById(`app`)!, {
507
+ capabilities: [motionCapability()],
508
+ })
509
+
510
+ ```
511
+
512
+ Use motion:initial, motion:animate, motion:exit, motion:transition, motion:whileHover, and motion:whileTap directly on native elements or custom tags. These are framework properties, separate from native attributes: they never become HTML attributes. An unregistered namespace or unsupported motion property produces an error. Standard XML, XMLNS, and XLink attribute namespaces retain their normal behavior.
513
+
514
+ ```tsx
515
+ import type { VNode } from "@atom.io/spa"
516
+ import { useSetter, useValue } from "@atom.io/spa"
517
+ import { atom } from "atom.io"
518
+
519
+ const targetXAtom = atom<number>({ key: `targetX`, default: 0 })
520
+ export function MotionPanel(): VNode {
521
+ const x = useValue(targetXAtom)
522
+ const setX = useSetter(targetXAtom)
523
+ return (
524
+ <section>
525
+ <button
526
+ onClick={() => {
527
+ setX((value) => (value === 0 ? 200 : 0))
528
+ }}
529
+ >
530
+ Move
531
+ </button>
532
+ <sliding-panel
533
+ style="display: block; width: 120px; padding: 16px; background: coral"
534
+ motion:initial={{ opacity: 0, x: -100 }}
535
+ motion:animate={{ opacity: 1, x: x() }}
536
+ motion:transition={{ type: `spring`, stiffness: 180, damping: 22 }}
537
+ motion:whileHover={{ scale: 1.05 }}
538
+ motion:whileTap={{ scale: 0.95 }}
539
+ >
540
+ Motion, with your own markup.
541
+ </sliding-panel>
542
+ </section>
543
+ )
544
+ }
545
+
546
+ ```
547
+
548
+ Motion targets update reactively without rerunning component setup. The target stays in atom.io; intermediate values and velocity remain in Motion. Spring transitions preserve motion-value continuity when retargeted. Duration-based tween transitions are also supported. Set initial to false to begin at the first animate target. DOM targets accept scalar CSS values and independent transforms, including custom CSS properties. Keyframe sequences, layout animation, and variant propagation are outside this initial API.
549
+
550
+ Motion respects the user's reduced-motion preference by default, including changes while mounted. The capability's reducedMotion option can be user, always, or never. Owner cleanup stops animations and releases effects, gesture handlers, and media-query listeners. Removing the capability properties releases that node's binding. Avoid assigning the same property through both native attributes/styles and motion targets: motion owns the properties it animates.
551
+
552
+ The same attributes animate numeric Konva properties and colors, or Three.js position, rotation, scale, light/material color, opacity, and intensity. Three.js rotation uses Euler components, not quaternion interpolation. DOM hover and tap use Motion's gesture handling; Konva gestures use native pointer events. Three.js gestures use the same raycast event layer as ordinary scene pointer handlers.
553
+
554
+ ```tsx
555
+ import type { VNode } from "@atom.io/spa"
556
+ import { useValue } from "@atom.io/spa"
557
+ import {
558
+ BoxGeometry,
559
+ Canvas,
560
+ Mesh,
561
+ MeshNormalMaterial,
562
+ } from "@atom.io/spa/three"
563
+ import { atom } from "atom.io"
564
+
565
+ const targetXAtom = atom<number>({
566
+ key: `targetX`,
567
+ default: 1,
568
+ })
569
+ // Mount under a root with capabilities: [motionCapability()].
570
+ export function SpringCube(): VNode {
571
+ const x = useValue(targetXAtom)
572
+ return (
573
+ <Canvas>
574
+ <Mesh
575
+ motion:initial={{ position: [-1, 0, 0], scale: 0 }}
576
+ motion:animate={{ position: [x(), 0, 0], scale: 1 }}
577
+ motion:transition={{ type: `spring`, stiffness: 180, damping: 22 }}
578
+ motion:whileHover={{ scale: 1.2 }}
579
+ motion:whileTap={{ scale: 0.8 }}
580
+ onPointerDown={(event) => {
581
+ event.setPointerCapture()
582
+ }}
583
+ >
584
+ <BoxGeometry />
585
+ <MeshNormalMaterial />
586
+ </Mesh>
587
+ </Canvas>
588
+ )
589
+ }
590
+
591
+ ```
592
+
593
+ When the motion capability is installed, Canvas draws in Motion's render phase after animated scene values update. Without it, Canvas uses requestAnimationFrame. Both drawing subscriptions and animations end with their owners. The base runtime imports no motion engine or retention coordinator. Presence hooks add approximately 300 bytes of gzip to the released 3.7 kB client surface; the optional Motion entrypoint owns the retention machinery. The full client budget is 4,100 bytes.
594
+
595
+ ### Exit animations and re-entry
596
+
597
+ Declare motion:exit on an element, custom tag, Konva node, or Three.js scene node. Conditional or keyed removal starts that target from its current Motion values. No presence wrapper is required. Register motionCapability as above.
598
+
599
+ ```tsx
600
+ import type { VNode } from "@atom.io/spa"
601
+ import { useSetter, useValue } from "@atom.io/spa"
602
+ import { atom } from "atom.io"
603
+
604
+ const visibleAtom = atom<boolean>({ key: `visible`, default: true })
605
+ export function DismissiblePanel(): VNode {
606
+ const visible = useValue(visibleAtom)
607
+ const setVisible = useSetter(visibleAtom)
608
+ return (
609
+ <section>
610
+ <button
611
+ onClick={() => {
612
+ setVisible((value) => !value)
613
+ }}
614
+ >
615
+ Toggle panel
616
+ </button>
617
+ {visible() && (
618
+ <sliding-panel
619
+ key="panel"
620
+ motion:initial={{ opacity: 0, y: 12 }}
621
+ motion:animate={{ opacity: 1, y: 0 }}
622
+ motion:exit={{ opacity: 0, y: -12 }}
623
+ motion:transition={{ type: `spring`, stiffness: 180, damping: 22 }}
624
+ >
625
+ The same instance returns if toggled before its exit completes.
626
+ </sliding-panel>
627
+ )}
628
+ </section>
629
+ )
630
+ }
631
+
632
+ ```
633
+
634
+ In the repository, the runnable source lives in [examples/motion](https://github.com/jeremybanka/atom.io/tree/main/packages/spa/examples/motion), including its standalone Vite entrypoint and visual recorder. Run the package’s example:motion script to start it locally.
635
+
636
+ Try the [motion sandbox](https://atom.io.fyi/spa-motion-lab) to interrupt a 2s tween at adjustable speeds, inspect rendered positions and velocities, scrub the captured sequence, or export PNG and JSON evidence.
637
+
638
+ SPA retains the entire removed subtree until all its exit targets finish, including independently exiting descendants adopted by an exiting ancestor. Native nodes, scene attachments, refs, subscriptions, renderers, geometries, and materials remain owned until final disposal. When keyed Mesh resources are replaced, the incoming geometry and material attach immediately; outgoing resources remain owned through their exits without occupying those attachment slots. Removing a resource without a replacement keeps it attached until its exit finishes. Replacing resources does not render a crossfade between them. Siblings keep their instances; retained ranges keep their previous position. A target without an exit is removed immediately unless another exit retains its enclosing subtree.
639
+
640
+ Returning the same key and component or element type before disposal cancels the exit and resumes the original instance against the latest props and state. Setup, mount callbacks, and refs do not run again. Motion keeps the current animated values and spring velocity. Moving numeric tweens also preserve velocity, including matching CSS units and scene tuple components: the first 20% of the new duration brakes to rest, then the remaining 80% returns smoothly to the latest animate target. Interrupted tweens begin immediately and use this return curve instead of restarting their authored delay or easing. Fresh tweens keep their authored timing, and zero-duration or reduced-motion updates remain immediate. Discrete and nonnumeric styles retain Motion’s native interpolation. Reusing a key with an incompatible type creates a separate instance; the old generation finishes independently. Keys have meaning within their original child collection. Reordering or reparenting into another collection does not transfer ownership.
641
+
642
+ During exit, reactive attributes, child reconciliation, user events, gestures, and user onSceneFrame/onFrame callbacks pause. Renderer frame infrastructure continues drawing animated scenes. DOM nodes become inert, aria-hidden, and unavailable to pointer input; owned focus is blurred and is not automatically restored on return. Konva nodes stop listening and cancel both pending and active drags, including descendant drags when an ancestor exits. Re-entry restores the authored draggable settings; a fresh press is required to start dragging again. Three.js objects leave picking and release active pointer interaction state. Re-entry restores their prior interaction settings and handlers.
643
+
644
+ Exit props and transition settings are read at logical removal; later state changes do not retarget an exiting subtree. Exits use the same transition as animate, defaulting to a spring. Explicit durations, visualDuration, and delays must be finite and nonnegative; velocity must be finite, bounce must be in the range \[0, 1), and stiffness, damping, mass, restDelta, and restSpeed must be finite and positive so exits can settle. Reduced motion skips retention; enabling it during an exit completes that exit. Server rendering omits capability attributes and never starts exits; hydration attaches them for later removals.
645
+
646
+ Root disposal and fatal errors bypass exits, stop active work, and release resources immediately. Stale animation completions cannot dispose a revived instance. This API covers exit retention and cancellation; layout/pop-layout animation, variants, presence wrappers, and automatic reparenting remain outside its scope.
647
+
648
+ ### Renderer extensions
649
+
650
+ The renderer entrypoint exposes createSceneRenderer, sceneComponent, bindScene, and onSceneFrame for imperative scene adapters. A host supplies creation, property updates, ordered child attachment, and destruction. Its children callback receives the parent, all owned children including retained exits, and the active children in that collection. Single resource slots can use active children for replacement while retaining ownership of outgoing resources. Children of an exiting parent keep their attachments until disposal. An optional target adapter exposes native property access and events to capabilities. The shared renderer supplies reactive bindings, keyed identity, refs, and cleanup. Use mount inside an owned component or mount callback to inherit its store, capabilities, and lifetime, or render with an explicit parent and optional root options to create a standalone scene root. Scene targets must be dedicated to their renderer's children. Scene subtrees do not support text nodes or hydration; their DOM boundaries defer graphics creation until browser mount. Server rendering validates and omits capability attributes without starting animations.
package/README.mdx CHANGED
@@ -11,6 +11,12 @@ import AstroConfig from "./exhibits/astro.config.ts" with { type: "code" };
11
11
  import AsyncAstro from "./exhibits/async-astro.spa.tsx" with { type: "code" };
12
12
  import Counter from "./exhibits/Counter.spa.tsx" with { type: "code" };
13
13
  import Verify from "./exhibits/verify.sh" with { type: "code" };
14
+ import KonvaExample from "./exhibits/konva.spa.tsx" with { type: "code" };
15
+ import ThreeExample from "./exhibits/three.spa.tsx" with { type: "code" };
16
+ import MotionPanel from "./exhibits/motion.spa.tsx" with { type: "code" };
17
+ import MotionMain from "./exhibits/motion-main.tsx" with { type: "code" };
18
+ import MotionExit from "./exhibits/motion-exit.spa.tsx" with { type: "code" };
19
+ import MotionThree from "./exhibits/motion-three.spa.tsx" with { type: "code" };
14
20
 
15
21
  <p align="center">
16
22
  <img src="https://raw.githubusercontent.com/jeremybanka/atom.io/main/apps/atom.io.fyi/public/spa/icon-512.png" alt="SPA logo" width="160" height="160" />
@@ -131,7 +137,7 @@ The checked Astro fixture demonstrates default/named slots and custom independen
131
137
 
132
138
  The build audits every browser export, including the JSX runtime, from the built JavaScript. Atom.io is an external peer in the incremental measurement. Compiler, server, and integration code have separate entrypoints. The report also includes the complete client plus atom.io, the Astro client entrypoint, and the installed Preact version under the same bundling/minification settings. These are full exported surfaces, not equivalent application benchmarks.
133
139
 
134
- The hard budget is under 3,400 bytes of ordinary level-9 gzip for the complete client export surface. Tsdown builds the package JavaScript and declarations, with separate production and development outputs that each share their runtime across entrypoints. The size audit then bundles the built exports with esbuild, minifies with Oxc, and measures compression using Node's gzip and Brotli implementations. The spa client measures 3,358 bytes with gzip. Actual application bundles add atom.io and compiler-generated application code.
140
+ The hard budget is under 4,100 bytes of ordinary level-9 gzip for the complete client export surface. Tsdown builds the package JavaScript and declarations, with separate production and development outputs that each share their runtime across entrypoints. The size audit then bundles the built exports with esbuild, minifies with Oxc, and measures compression using Node's gzip and Brotli implementations. The complete client export surface measures approximately 4.0 kB with gzip; dist/size.json records the exact build measurements. Actual application bundles add atom.io and compiler-generated application code.
135
141
 
136
142
  Build output includes the minified audit entrypoint and machine-readable dist/size.json. These audit files are a bundled measurement; use the package exports in applications so the bundler preserves one runtime instance across entrypoints. Source tests exercise development behavior; the production test executes the audited minified artifact. Chromium checks exercise the actual Astro build, island isolation, hydration, keyed identity, focus/selection, SVG namespaces, and teardown. A fresh-cache Astro development check also covers mount hooks, shared state, and ClientRouter navigation.
137
143
 
@@ -148,3 +154,79 @@ Tonnage measures combined browser bundles containing SPA and atom.io, with share
148
154
  ## License
149
155
 
150
156
  MPL-2.0 or later. See [LICENSE](./LICENSE).
157
+
158
+ ## Optional graphics and motion
159
+
160
+ SPA includes Konva, Three.js, and Motion integrations behind separate entrypoints. Install only the engines you use. Konva, three, @types/three, and motion are optional peers; the main runtime and JSX declarations work without them installed. Importing the base entrypoint does not load any animation or graphics engine, and each integration's bundle excludes the other engines. These boundaries are verified with isolated consumer and bundle checks.
161
+
162
+ ### Konva
163
+
164
+ Import Stage, Layer, Group, Rect, Circle, Ellipse, Line, Text, Image, Path, Star, and Transformer from @atom.io/spa/konva. Stage renders a DOM container and creates its native stage after browser mounting. Compiled atom reads update native attributes; keyed children preserve node identity. Native configuration attributes and onClick, onPointerDown, onDragMove, and onDragEnd handlers are supported. Refs receive native nodes and null on cleanup. Removal destroys owned nodes and listeners.
165
+
166
+ <KonvaExample />
167
+
168
+ Konva owns hit testing, dragging, and draw batching. Write drag results back into atoms to keep document state synchronized. The exported konvaRenderer can also render into a borrowed container dedicated to its scene children.
169
+
170
+ ### Three.js
171
+
172
+ Import Canvas, Group, Mesh, PerspectiveCamera, AmbientLight, DirectionalLight, BoxGeometry, SphereGeometry, PlaneGeometry, MeshStandardMaterial, MeshBasicMaterial, and MeshNormalMaterial from @atom.io/spa/three. Canvas creates a WebGL renderer after browser mounting. Geometry and material children attach to their Mesh, with one of each supported. Position and rotation accept three-number tuples; scale also accepts a scalar.
173
+
174
+ <ThreeExample />
175
+
176
+ Constructor args are fixed for an instance. To change them, replace the resource with a new key in a reactive child collection. Refs expose native objects. Owned geometries and materials are disposed on removal; textures passed through material properties remain borrowed. Canvas stops drawing and disposes its renderer on removal. The exported threeRenderer renders into a borrowed parent dedicated to its children without creating a WebGL renderer.
177
+
178
+ Canvas defaults to a perspective camera at z = 5. Its optional camera prop borrows an external camera; a PerspectiveCamera child does not automatically become active. Width and height update the renderer and default camera. Canvas renders continuously and accepts an onFrame callback with scene, camera, renderer, delta seconds, and timestamp seconds. Controls, asset loading, and drawing on demand are outside this initial API.
179
+
180
+ ### Three.js pointer events
181
+
182
+ Mesh and group components accept onPointerDown, onPointerUp, onPointerMove, onPointerEnter, onPointerLeave, onPointerOver, onPointerOut, onPointerCancel, and onClick handlers. Canvas converts CSS pointer coordinates into a ray through the current camera, updates world matrices, and picks the nearest visible object on the camera's layers. That object occludes objects behind it even when it has no handlers. Three.js material sidedness controls which surfaces can be picked.
183
+
184
+ Events bubble from the picked object through its scene ancestors; stopPropagation stops ancestor delivery. Enter and leave notifications describe each ancestor's hover boundary without repeating when moving between its children. Hover is tracked per pointer and re-evaluated each frame, so moving objects and cameras update hover even when the pointer stays still. Hidden ancestry and hidden materials are excluded.
185
+
186
+ A ThreePointerEvent exposes nativeEvent, target (the receiving leaf or captured object), currentTarget (the handler's object), intersection, ray, pointerId, button, buttons, clientX, clientY, preventDefault, stopPropagation, and setPointerCapture/releasePointerCapture/hasPointerCapture methods scoped to that handler's object. Capturing on a group retargets subsequent events to that group. Off-object captured events retain the capture's last intersection; use the current ray for drag-plane calculations. A primary-button click is emitted only when press and release pick the same leaf.
187
+
188
+ Canvas retains native pointer delivery during a press. Releasing outside a pressed object cancels it unless a scene object explicitly captured the pointer; captured objects still receive the release outside the canvas. Pointer cancellation, browser capture loss, subtree removal, and Canvas disposal clear interaction state and release native capture. Cleanup continues if removal callbacks fail. Borrowed scenes can use createThreeEvents directly, call update after changing the scene, remove to release a subtree's interaction state, and dispose when the surface is released.
189
+
190
+ ### Declarative motion capabilities
191
+
192
+ Import motionCapability from @atom.io/spa/motion and register it explicitly in render or hydrate options. Importing that entrypoint also supplies JSX type augmentation. Registration belongs to one root, is inherited by its scene subtrees, and never modifies a global registry. Astro islands can set their component's capabilities property to the same array; the integration supplies it to both server rendering and browser hydration.
193
+
194
+ <MotionMain />
195
+
196
+ Use motion:initial, motion:animate, motion:exit, motion:transition, motion:whileHover, and motion:whileTap directly on native elements or custom tags. These are framework properties, separate from native attributes: they never become HTML attributes. An unregistered namespace or unsupported motion property produces an error. Standard XML, XMLNS, and XLink attribute namespaces retain their normal behavior.
197
+
198
+ <MotionPanel />
199
+
200
+ Motion targets update reactively without rerunning component setup. The target stays in atom.io; intermediate values and velocity remain in Motion. Spring transitions preserve motion-value continuity when retargeted. Duration-based tween transitions are also supported. Set initial to false to begin at the first animate target. DOM targets accept scalar CSS values and independent transforms, including custom CSS properties. Keyframe sequences, layout animation, and variant propagation are outside this initial API.
201
+
202
+ Motion respects the user's reduced-motion preference by default, including changes while mounted. The capability's reducedMotion option can be user, always, or never. Owner cleanup stops animations and releases effects, gesture handlers, and media-query listeners. Removing the capability properties releases that node's binding. Avoid assigning the same property through both native attributes/styles and motion targets: motion owns the properties it animates.
203
+
204
+ The same attributes animate numeric Konva properties and colors, or Three.js position, rotation, scale, light/material color, opacity, and intensity. Three.js rotation uses Euler components, not quaternion interpolation. DOM hover and tap use Motion's gesture handling; Konva gestures use native pointer events. Three.js gestures use the same raycast event layer as ordinary scene pointer handlers.
205
+
206
+ <MotionThree />
207
+
208
+ When the motion capability is installed, Canvas draws in Motion's render phase after animated scene values update. Without it, Canvas uses requestAnimationFrame. Both drawing subscriptions and animations end with their owners. The base runtime imports no motion engine or retention coordinator. Presence hooks add approximately 300 bytes of gzip to the released 3.7 kB client surface; the optional Motion entrypoint owns the retention machinery. The full client budget is 4,100 bytes.
209
+
210
+ ### Exit animations and re-entry
211
+
212
+ Declare motion:exit on an element, custom tag, Konva node, or Three.js scene node. Conditional or keyed removal starts that target from its current Motion values. No presence wrapper is required. Register motionCapability as above.
213
+
214
+ <MotionExit />
215
+
216
+ In the repository, the runnable source lives in [examples/motion](https://github.com/jeremybanka/atom.io/tree/main/packages/spa/examples/motion), including its standalone Vite entrypoint and visual recorder. Run the package’s example:motion script to start it locally.
217
+
218
+ Try the [motion sandbox](https://atom.io.fyi/spa-motion-lab) to interrupt a 2s tween at adjustable speeds, inspect rendered positions and velocities, scrub the captured sequence, or export PNG and JSON evidence.
219
+
220
+ SPA retains the entire removed subtree until all its exit targets finish, including independently exiting descendants adopted by an exiting ancestor. Native nodes, scene attachments, refs, subscriptions, renderers, geometries, and materials remain owned until final disposal. When keyed Mesh resources are replaced, the incoming geometry and material attach immediately; outgoing resources remain owned through their exits without occupying those attachment slots. Removing a resource without a replacement keeps it attached until its exit finishes. Replacing resources does not render a crossfade between them. Siblings keep their instances; retained ranges keep their previous position. A target without an exit is removed immediately unless another exit retains its enclosing subtree.
221
+
222
+ Returning the same key and component or element type before disposal cancels the exit and resumes the original instance against the latest props and state. Setup, mount callbacks, and refs do not run again. Motion keeps the current animated values and spring velocity. Moving numeric tweens also preserve velocity, including matching CSS units and scene tuple components: the first 20% of the new duration brakes to rest, then the remaining 80% returns smoothly to the latest animate target. Interrupted tweens begin immediately and use this return curve instead of restarting their authored delay or easing. Fresh tweens keep their authored timing, and zero-duration or reduced-motion updates remain immediate. Discrete and nonnumeric styles retain Motion’s native interpolation. Reusing a key with an incompatible type creates a separate instance; the old generation finishes independently. Keys have meaning within their original child collection. Reordering or reparenting into another collection does not transfer ownership.
223
+
224
+ During exit, reactive attributes, child reconciliation, user events, gestures, and user onSceneFrame/onFrame callbacks pause. Renderer frame infrastructure continues drawing animated scenes. DOM nodes become inert, aria-hidden, and unavailable to pointer input; owned focus is blurred and is not automatically restored on return. Konva nodes stop listening and cancel both pending and active drags, including descendant drags when an ancestor exits. Re-entry restores the authored draggable settings; a fresh press is required to start dragging again. Three.js objects leave picking and release active pointer interaction state. Re-entry restores their prior interaction settings and handlers.
225
+
226
+ Exit props and transition settings are read at logical removal; later state changes do not retarget an exiting subtree. Exits use the same transition as animate, defaulting to a spring. Explicit durations, visualDuration, and delays must be finite and nonnegative; velocity must be finite, bounce must be in the range [0, 1), and stiffness, damping, mass, restDelta, and restSpeed must be finite and positive so exits can settle. Reduced motion skips retention; enabling it during an exit completes that exit. Server rendering omits capability attributes and never starts exits; hydration attaches them for later removals.
227
+
228
+ Root disposal and fatal errors bypass exits, stop active work, and release resources immediately. Stale animation completions cannot dispose a revived instance. This API covers exit retention and cancellation; layout/pop-layout animation, variants, presence wrappers, and automatic reparenting remain outside its scope.
229
+
230
+ ### Renderer extensions
231
+
232
+ The renderer entrypoint exposes createSceneRenderer, sceneComponent, bindScene, and onSceneFrame for imperative scene adapters. A host supplies creation, property updates, ordered child attachment, and destruction. Its children callback receives the parent, all owned children including retained exits, and the active children in that collection. Single resource slots can use active children for replacement while retaining ownership of outgoing resources. Children of an exiting parent keep their attachments until disposal. An optional target adapter exposes native property access and events to capabilities. The shared renderer supplies reactive bindings, keyed identity, refs, and cleanup. Use mount inside an owned component or mount callback to inherit its store, capabilities, and lifetime, or render with an explicit parent and optional root options to create a standalone scene root. Scene targets must be dedicated to their renderer's children. Scene subtrees do not support text nodes or hydration; their DOM boundaries defer graphics creation until browser mount. Server rendering validates and omits capability attributes without starting animations.
@@ -1,4 +1,4 @@
1
- import { t as AstroApplicationContext } from "./astro-shared-DkZaqX7L.js";
1
+ import { t as AstroApplicationContext } from "./astro-shared-BkWvVZWZ.js";
2
2
  type Lifetime = {
3
3
  signal: AbortSignal;
4
4
  onCleanup(cleanup: () => void): () => void;
@@ -1,5 +1,5 @@
1
1
  import { t as applicationContext } from "./astro-context-OdlexHR4.js";
2
- import { IMPLICIT, withdraw } from "atom.io/internal";
2
+ import { IMPLICIT, subscribeToStateSubject, withdraw } from "atom.io/internal";
3
3
  // src/astro-application.ts
4
4
  const applications = /* @__PURE__ */ new WeakMap();
5
5
  /** Called by the integration's early page script, before island preparation. */
@@ -21,7 +21,7 @@ function browserApplication(document) {
21
21
  if (store.valueMap.has(token.key)) changed();
22
22
  subscriptions.get(token.key)?.();
23
23
  const state = withdraw(store, token);
24
- subscriptions.set(token.key, state.subject.subscribe(`spa:bootstrap`, changed));
24
+ subscriptions.set(token.key, subscribeToStateSubject(state, `spa:bootstrap`, changed));
25
25
  };
26
26
  for (const state of [
27
27
  ...store.atoms.values(),
@@ -1 +1 @@
1
- {"version":3,"file":"astro-application.js","names":[],"sources":["../src/astro-application.ts"],"sourcesContent":["import type { ReadableToken } from \"atom.io\"\nimport { IMPLICIT, withdraw } from \"atom.io/internal\"\n\nimport { applicationContext } from \"./astro-context.ts\"\n\nconst applications = new WeakMap<\n\tDocument,\n\tReturnType<typeof applicationContext>\n>()\n\n/** Called by the integration's early page script, before island preparation. */\nexport function browserApplication(\n\tdocument: Document,\n): ReturnType<typeof applicationContext> {\n\tlet application = applications.get(document)\n\tif (application) return application\n\tapplication = applicationContext()\n\tconst app = application\n\tconst store = IMPLICIT.STORE\n\tconst originalDefault = store.runDefault\n\tapplications.set(document, app)\n\tconst changed = () => {\n\t\tapp.canResume = false\n\t}\n\tconst internal = (key: string) => key.startsWith(`🔍 spa islands`)\n\tconst subscriptions = new Map<string, () => void>()\n\tconst watch = (token: ReadableToken<unknown, any, any>) => {\n\t\tif (internal(token.key)) return\n\t\tif (store.valueMap.has(token.key)) changed()\n\t\tsubscriptions.get(token.key)?.()\n\t\tconst state = withdraw(store, token)\n\t\tsubscriptions.set(\n\t\t\ttoken.key,\n\t\t\tstate.subject.subscribe(`spa:bootstrap`, changed),\n\t\t)\n\t}\n\tfor (const state of [\n\t\t...store.atoms.values(),\n\t\t...store.readonlySelectors.values(),\n\t\t...store.writableSelectors.values(),\n\t])\n\t\twatch(state)\n\tconst removed = (token: ReadableToken<unknown, any, any>) => {\n\t\tif (!internal(token.key)) {\n\t\t\tchanged()\n\t\t\tsubscriptions.get(token.key)?.()\n\t\t\tsubscriptions.delete(token.key)\n\t\t}\n\t}\n\tconst events = [\n\t\tstore.on.atomCreation.subscribe(`spa:bootstrap`, watch),\n\t\tstore.on.selectorCreation.subscribe(`spa:bootstrap`, watch),\n\t\tstore.on.atomDisposal.subscribe(`spa:bootstrap`, removed),\n\t\tstore.on.selectorDisposal.subscribe(`spa:bootstrap`, removed),\n\t\tstore.on.transactionCommit.subscribe(`spa:bootstrap`, changed),\n\t]\n\tdocument.addEventListener(`astro:before-swap`, changed)\n\tconst pagehide = (event: PageTransitionEvent) => {\n\t\tif (!event.persisted) app.dispose()\n\t}\n\tdocument.defaultView?.addEventListener(`pagehide`, pagehide)\n\tapp.onCleanup(() => {\n\t\tfor (const unsubscribe of subscriptions.values()) unsubscribe()\n\t\tfor (const unsubscribe of events) unsubscribe()\n\t\tdocument.removeEventListener(`astro:before-swap`, changed)\n\t\tdocument.defaultView?.removeEventListener(`pagehide`, pagehide)\n\t\tstore.runDefault = originalDefault\n\t\tapplications.delete(document)\n\t})\n\treturn app\n}\n"],"mappings":";;;AAKA,MAAM,+BAAe,IAAI,QAGvB;;AAGF,SAAgB,mBACf,UACwC;CACxC,IAAI,cAAc,aAAa,IAAI,QAAQ;CAC3C,IAAI,aAAa,OAAO;CACxB,cAAc,mBAAmB;CACjC,MAAM,MAAM;CACZ,MAAM,QAAQ,SAAS;CACvB,MAAM,kBAAkB,MAAM;CAC9B,aAAa,IAAI,UAAU,GAAG;CAC9B,MAAM,gBAAgB;EACrB,IAAI,YAAY;CACjB;CACA,MAAM,YAAY,QAAgB,IAAI,WAAW,gBAAgB;CACjE,MAAM,gCAAgB,IAAI,IAAwB;CAClD,MAAM,SAAS,UAA4C;EAC1D,IAAI,SAAS,MAAM,GAAG,GAAG;EACzB,IAAI,MAAM,SAAS,IAAI,MAAM,GAAG,GAAG,QAAQ;EAC3C,cAAc,IAAI,MAAM,GAAG,CAAC,GAAG;EAC/B,MAAM,QAAQ,SAAS,OAAO,KAAK;EACnC,cAAc,IACb,MAAM,KACN,MAAM,QAAQ,UAAU,iBAAiB,OAAO,CACjD;CACD;CACA,KAAK,MAAM,SAAS;EACnB,GAAG,MAAM,MAAM,OAAO;EACtB,GAAG,MAAM,kBAAkB,OAAO;EAClC,GAAG,MAAM,kBAAkB,OAAO;CACnC,GACC,MAAM,KAAK;CACZ,MAAM,WAAW,UAA4C;EAC5D,IAAI,CAAC,SAAS,MAAM,GAAG,GAAG;GACzB,QAAQ;GACR,cAAc,IAAI,MAAM,GAAG,CAAC,GAAG;GAC/B,cAAc,OAAO,MAAM,GAAG;EAC/B;CACD;CACA,MAAM,SAAS;EACd,MAAM,GAAG,aAAa,UAAU,iBAAiB,KAAK;EACtD,MAAM,GAAG,iBAAiB,UAAU,iBAAiB,KAAK;EAC1D,MAAM,GAAG,aAAa,UAAU,iBAAiB,OAAO;EACxD,MAAM,GAAG,iBAAiB,UAAU,iBAAiB,OAAO;EAC5D,MAAM,GAAG,kBAAkB,UAAU,iBAAiB,OAAO;CAC9D;CACA,SAAS,iBAAiB,qBAAqB,OAAO;CACtD,MAAM,YAAY,UAA+B;EAChD,IAAI,CAAC,MAAM,WAAW,IAAI,QAAQ;CACnC;CACA,SAAS,aAAa,iBAAiB,YAAY,QAAQ;CAC3D,IAAI,gBAAgB;EACnB,KAAK,MAAM,eAAe,cAAc,OAAO,GAAG,YAAY;EAC9D,KAAK,MAAM,eAAe,QAAQ,YAAY;EAC9C,SAAS,oBAAoB,qBAAqB,OAAO;EACzD,SAAS,aAAa,oBAAoB,YAAY,QAAQ;EAC9D,MAAM,aAAa;EACnB,aAAa,OAAO,QAAQ;CAC7B,CAAC;CACD,OAAO;AACR"}
1
+ {"version":3,"file":"astro-application.js","names":[],"sources":["../src/astro-application.ts"],"sourcesContent":["import type { ReadableToken } from \"atom.io\"\nimport { IMPLICIT, subscribeToStateSubject, withdraw } from \"atom.io/internal\"\n\nimport { applicationContext } from \"./astro-context.ts\"\n\nconst applications = new WeakMap<\n\tDocument,\n\tReturnType<typeof applicationContext>\n>()\n\n/** Called by the integration's early page script, before island preparation. */\nexport function browserApplication(\n\tdocument: Document,\n): ReturnType<typeof applicationContext> {\n\tlet application = applications.get(document)\n\tif (application) return application\n\tapplication = applicationContext()\n\tconst app = application\n\tconst store = IMPLICIT.STORE\n\tconst originalDefault = store.runDefault\n\tapplications.set(document, app)\n\tconst changed = () => {\n\t\tapp.canResume = false\n\t}\n\tconst internal = (key: string) => key.startsWith(`🔍 spa islands`)\n\tconst subscriptions = new Map<string, () => void>()\n\tconst watch = (token: ReadableToken<unknown, any, any>) => {\n\t\tif (internal(token.key)) return\n\t\tif (store.valueMap.has(token.key)) changed()\n\t\tsubscriptions.get(token.key)?.()\n\t\tconst state = withdraw(store, token)\n\t\tsubscriptions.set(\n\t\t\ttoken.key,\n\t\t\tsubscribeToStateSubject(state, `spa:bootstrap`, changed),\n\t\t)\n\t}\n\tfor (const state of [\n\t\t...store.atoms.values(),\n\t\t...store.readonlySelectors.values(),\n\t\t...store.writableSelectors.values(),\n\t])\n\t\twatch(state)\n\tconst removed = (token: ReadableToken<unknown, any, any>) => {\n\t\tif (!internal(token.key)) {\n\t\t\tchanged()\n\t\t\tsubscriptions.get(token.key)?.()\n\t\t\tsubscriptions.delete(token.key)\n\t\t}\n\t}\n\tconst events = [\n\t\tstore.on.atomCreation.subscribe(`spa:bootstrap`, watch),\n\t\tstore.on.selectorCreation.subscribe(`spa:bootstrap`, watch),\n\t\tstore.on.atomDisposal.subscribe(`spa:bootstrap`, removed),\n\t\tstore.on.selectorDisposal.subscribe(`spa:bootstrap`, removed),\n\t\tstore.on.transactionCommit.subscribe(`spa:bootstrap`, changed),\n\t]\n\tdocument.addEventListener(`astro:before-swap`, changed)\n\tconst pagehide = (event: PageTransitionEvent) => {\n\t\tif (!event.persisted) app.dispose()\n\t}\n\tdocument.defaultView?.addEventListener(`pagehide`, pagehide)\n\tapp.onCleanup(() => {\n\t\tfor (const unsubscribe of subscriptions.values()) unsubscribe()\n\t\tfor (const unsubscribe of events) unsubscribe()\n\t\tdocument.removeEventListener(`astro:before-swap`, changed)\n\t\tdocument.defaultView?.removeEventListener(`pagehide`, pagehide)\n\t\tstore.runDefault = originalDefault\n\t\tapplications.delete(document)\n\t})\n\treturn app\n}\n"],"mappings":";;;AAKA,MAAM,+BAAe,IAAI,QAGvB;;AAGF,SAAgB,mBACf,UACwC;CACxC,IAAI,cAAc,aAAa,IAAI,QAAQ;CAC3C,IAAI,aAAa,OAAO;CACxB,cAAc,mBAAmB;CACjC,MAAM,MAAM;CACZ,MAAM,QAAQ,SAAS;CACvB,MAAM,kBAAkB,MAAM;CAC9B,aAAa,IAAI,UAAU,GAAG;CAC9B,MAAM,gBAAgB;EACrB,IAAI,YAAY;CACjB;CACA,MAAM,YAAY,QAAgB,IAAI,WAAW,gBAAgB;CACjE,MAAM,gCAAgB,IAAI,IAAwB;CAClD,MAAM,SAAS,UAA4C;EAC1D,IAAI,SAAS,MAAM,GAAG,GAAG;EACzB,IAAI,MAAM,SAAS,IAAI,MAAM,GAAG,GAAG,QAAQ;EAC3C,cAAc,IAAI,MAAM,GAAG,CAAC,GAAG;EAC/B,MAAM,QAAQ,SAAS,OAAO,KAAK;EACnC,cAAc,IACb,MAAM,KACN,wBAAwB,OAAO,iBAAiB,OAAO,CACxD;CACD;CACA,KAAK,MAAM,SAAS;EACnB,GAAG,MAAM,MAAM,OAAO;EACtB,GAAG,MAAM,kBAAkB,OAAO;EAClC,GAAG,MAAM,kBAAkB,OAAO;CACnC,GACC,MAAM,KAAK;CACZ,MAAM,WAAW,UAA4C;EAC5D,IAAI,CAAC,SAAS,MAAM,GAAG,GAAG;GACzB,QAAQ;GACR,cAAc,IAAI,MAAM,GAAG,CAAC,GAAG;GAC/B,cAAc,OAAO,MAAM,GAAG;EAC/B;CACD;CACA,MAAM,SAAS;EACd,MAAM,GAAG,aAAa,UAAU,iBAAiB,KAAK;EACtD,MAAM,GAAG,iBAAiB,UAAU,iBAAiB,KAAK;EAC1D,MAAM,GAAG,aAAa,UAAU,iBAAiB,OAAO;EACxD,MAAM,GAAG,iBAAiB,UAAU,iBAAiB,OAAO;EAC5D,MAAM,GAAG,kBAAkB,UAAU,iBAAiB,OAAO;CAC9D;CACA,SAAS,iBAAiB,qBAAqB,OAAO;CACtD,MAAM,YAAY,UAA+B;EAChD,IAAI,CAAC,MAAM,WAAW,IAAI,QAAQ;CACnC;CACA,SAAS,aAAa,iBAAiB,YAAY,QAAQ;CAC3D,IAAI,gBAAgB;EACnB,KAAK,MAAM,eAAe,cAAc,OAAO,GAAG,YAAY;EAC9D,KAAK,MAAM,eAAe,QAAQ,YAAY;EAC9C,SAAS,oBAAoB,qBAAqB,OAAO;EACzD,SAAS,aAAa,oBAAoB,YAAY,QAAQ;EAC9D,MAAM,aAAa;EACnB,aAAa,OAAO,QAAQ;CAC7B,CAAC;CACD,OAAO;AACR"}
@@ -1,4 +1,4 @@
1
- import { a as Island } from "./astro-shared-DkZaqX7L.js";
1
+ import { a as Island } from "./astro-shared-BkWvVZWZ.js";
2
2
  type Props = Record<string, any>;
3
3
  type Slots = Record<string, string>;
4
4
  type Hydrator = (component: Island, props: Props, slots: Slots, metadata: {
@@ -1,8 +1,8 @@
1
1
  import { browserApplication } from "./astro-application.js";
2
2
  import { n as failPreparation, r as storeContext } from "./astro-context-OdlexHR4.js";
3
3
  import { n as islandStore, t as island } from "./astro-shared-BT45auwR.js";
4
- import { s as onCleanup, y as useValue } from "./core-Dvqm7w2y.js";
5
- import { n as render, t as hydrate } from "./dom-BR9o9wZW.js";
4
+ import { b as useValue, c as onCleanup } from "./core-DCmqLZQP.js";
5
+ import { n as render, t as hydrate } from "./dom-dHQM0O7Q.js";
6
6
  import { IMPLICIT, createRegularAtomFamily, disposeFromStore, findInStore, setIntoStore } from "atom.io/internal";
7
7
  // src/astro-client.ts
8
8
  const roots = /* @__PURE__ */ new WeakMap();
@@ -65,7 +65,10 @@ var astro_client_default = (element) => async (component, props, slots, { client
65
65
  return () => island(component, value().props, value().slots);
66
66
  };
67
67
  if (replace) element.replaceChildren();
68
- const root = (replace ? render : hydrate)(mount, element, { store });
68
+ const root = (replace ? render : hydrate)(mount, element, {
69
+ store,
70
+ capabilities: component.capabilities ?? []
71
+ });
69
72
  lifetime.context.onCleanup(root.dispose);
70
73
  update = (next) => {
71
74
  setIntoStore(store, state, next);
@@ -1 +1 @@
1
- {"version":3,"file":"astro-client.js","names":[],"sources":["../src/astro-client.ts"],"sourcesContent":["import type { RegularAtomFamilyToken } from \"atom.io\"\nimport type { RootStore } from \"atom.io/internal\"\nimport {\n\tcreateRegularAtomFamily,\n\tdisposeFromStore,\n\tfindInStore,\n\tIMPLICIT,\n\tsetIntoStore,\n} from \"atom.io/internal\"\n\nimport { browserApplication } from \"./astro-application.ts\"\nimport { failPreparation, storeContext } from \"./astro-context.ts\"\nimport type { Island } from \"./astro-shared.ts\"\nimport { island, islandStore } from \"./astro-shared.ts\"\nimport { onCleanup, useValue } from \"./core.ts\"\nimport { hydrate, render } from \"./dom.ts\"\n\ntype Props = Record<string, any>\ntype Slots = Record<string, string>\ntype Hydrator = (\n\tcomponent: Island,\n\tprops: Props,\n\tslots: Slots,\n\tmetadata: { client: string },\n) => Promise<void>\nconst roots = new WeakMap<\n\tElement,\n\t{\n\t\tcomponent: Island\n\t\tready: Promise<void>\n\t\tupdate(props: Props, slots: Slots): void\n\t\tdispose(): void\n\t}\n>()\ntype State = { props: Props; slots: Slots }\nconst states = new WeakMap<RootStore, RegularAtomFamilyToken<State, number>>()\nlet serial = 0\n\nexport default (element: HTMLElement): Hydrator =>\n\tasync (component, props, slots, { client }) => {\n\t\tconst previous = roots.get(element)\n\t\tif (previous?.component === component) {\n\t\t\tprevious.update(props, slots)\n\t\t\treturn previous.ready\n\t\t}\n\t\tprevious?.dispose()\n\t\tconst shared = !component.createStore && !component.isolate\n\t\tconst application = shared\n\t\t\t? browserApplication(element.ownerDocument)\n\t\t\t: undefined\n\t\tif (application && client === `only`) application.canResume = false\n\t\tconst lifetime = storeContext(element, application)\n\t\tconst initial = { props, slots }\n\t\tlet current = initial\n\t\tlet update: ((value: State) => void) | undefined\n\t\tlet disposed = false\n\t\tconst dispose = () => {\n\t\t\tif (disposed) return\n\t\t\tdisposed = true\n\t\t\telement.removeEventListener(`astro:unmount`, dispose)\n\t\t\troots.delete(element)\n\t\t\tlifetime.dispose()\n\t\t}\n\t\t// Publish the pending owner before invoking user code. Repeated hydration\n\t\t// calls update its props and share its preparation rather than racing stores.\n\t\tconst ready = Promise.resolve().then(async () => {\n\t\t\tif (lifetime.context.signal.aborted) return\n\t\t\tlet mounting = false\n\t\t\ttry {\n\t\t\t\tconst store = await Promise.race([\n\t\t\t\t\tislandStore(\n\t\t\t\t\t\tcomponent,\n\t\t\t\t\t\tprops,\n\t\t\t\t\t\tlifetime.context,\n\t\t\t\t\t\tshared ? IMPLICIT.STORE : undefined,\n\t\t\t\t\t),\n\t\t\t\t\tlifetime.cancelled,\n\t\t\t\t])\n\t\t\t\tif (lifetime.context.signal.aborted) return\n\t\t\t\tmounting = true\n\t\t\t\tconst replace =\n\t\t\t\t\tclient === `only` ||\n\t\t\t\t\tprevious !== undefined ||\n\t\t\t\t\tapplication?.canResume === false\n\t\t\t\t// Astro leaves this sentinel on islands inserted by ClientRouter.\n\t\t\t\tconst sentinel = element.lastChild\n\t\t\t\tif (sentinel?.nodeType === 8 && sentinel.nodeValue === `astro:end`)\n\t\t\t\t\tsentinel.remove()\n\t\t\t\tlet family = states.get(store!)\n\t\t\t\tif (!family) {\n\t\t\t\t\tfamily = createRegularAtomFamily<State, number, never>(store!, {\n\t\t\t\t\t\tkey: `🔍 spa islands`,\n\t\t\t\t\t\tdefault: { props: {}, slots: {} },\n\t\t\t\t\t})\n\t\t\t\t\tstates.set(store!, family)\n\t\t\t\t}\n\t\t\t\tconst state = findInStore(store!, family, serial++)\n\t\t\t\tsetIntoStore(store!, state, replace ? current : initial)\n\t\t\t\tlifetime.context.onCleanup(() => {\n\t\t\t\t\tdisposeFromStore(store!, state)\n\t\t\t\t})\n\t\t\t\tconst mount = () => {\n\t\t\t\t\tonCleanup(dispose)\n\t\t\t\t\tconst value = useValue(state)\n\t\t\t\t\treturn () => island(component, value().props, value().slots)\n\t\t\t\t}\n\t\t\t\tif (replace) element.replaceChildren()\n\t\t\t\tconst root = (replace ? render : hydrate)(mount, element, {\n\t\t\t\t\tstore: store!,\n\t\t\t\t})\n\t\t\t\tlifetime.context.onCleanup(root.dispose)\n\t\t\t\tupdate = (next) => {\n\t\t\t\t\tsetIntoStore(store!, state, next)\n\t\t\t\t\troot.flush()\n\t\t\t\t}\n\t\t\t\t// Match the existing SSR tree before applying a structural prop update\n\t\t\t\t// that arrived while its store was still being prepared.\n\t\t\t\tif (!replace && current !== initial) update(current)\n\t\t\t} catch (error) {\n\t\t\t\tif (lifetime.context.signal.aborted && !mounting) return\n\t\t\t\tfailPreparation(error, dispose)\n\t\t\t}\n\t\t})\n\t\troots.set(element, {\n\t\t\tcomponent,\n\t\t\tready,\n\t\t\tupdate(nextProps, nextSlots) {\n\t\t\t\tcurrent = { props: nextProps, slots: nextSlots }\n\t\t\t\tupdate?.(current)\n\t\t\t},\n\t\t\tdispose,\n\t\t})\n\t\telement.addEventListener(`astro:unmount`, dispose, { once: true })\n\t\tlifetime.context.onCleanup(dispose)\n\t\treturn ready\n\t}\n"],"mappings":";;;;;;;AAyBA,MAAM,wBAAQ,IAAI,QAQhB;AAEF,MAAM,yBAAS,IAAI,QAA0D;AAC7E,IAAI,SAAS;AAEb,IAAA,wBAAgB,YACf,OAAO,WAAW,OAAO,OAAO,EAAE,aAAa;CAC9C,MAAM,WAAW,MAAM,IAAI,OAAO;CAClC,IAAI,UAAU,cAAc,WAAW;EACtC,SAAS,OAAO,OAAO,KAAK;EAC5B,OAAO,SAAS;CACjB;CACA,UAAU,QAAQ;CAClB,MAAM,SAAS,CAAC,UAAU,eAAe,CAAC,UAAU;CACpD,MAAM,cAAc,SACjB,mBAAmB,QAAQ,aAAa,IACxC,KAAA;CACH,IAAI,eAAe,WAAW,QAAQ,YAAY,YAAY;CAC9D,MAAM,WAAW,aAAa,SAAS,WAAW;CAClD,MAAM,UAAU;EAAE;EAAO;CAAM;CAC/B,IAAI,UAAU;CACd,IAAI;CACJ,IAAI,WAAW;CACf,MAAM,gBAAgB;EACrB,IAAI,UAAU;EACd,WAAW;EACX,QAAQ,oBAAoB,iBAAiB,OAAO;EACpD,MAAM,OAAO,OAAO;EACpB,SAAS,QAAQ;CAClB;CAGA,MAAM,QAAQ,QAAQ,QAAQ,CAAC,CAAC,KAAK,YAAY;EAChD,IAAI,SAAS,QAAQ,OAAO,SAAS;EACrC,IAAI,WAAW;EACf,IAAI;GACH,MAAM,QAAQ,MAAM,QAAQ,KAAK,CAChC,YACC,WACA,OACA,SAAS,SACT,SAAS,SAAS,QAAQ,KAAA,CAC3B,GACA,SAAS,SACV,CAAC;GACD,IAAI,SAAS,QAAQ,OAAO,SAAS;GACrC,WAAW;GACX,MAAM,UACL,WAAW,UACX,aAAa,KAAA,KACb,aAAa,cAAc;GAE5B,MAAM,WAAW,QAAQ;GACzB,IAAI,UAAU,aAAa,KAAK,SAAS,cAAc,aACtD,SAAS,OAAO;GACjB,IAAI,SAAS,OAAO,IAAI,KAAM;GAC9B,IAAI,CAAC,QAAQ;IACZ,SAAS,wBAA8C,OAAQ;KAC9D,KAAK;KACL,SAAS;MAAE,OAAO,CAAC;MAAG,OAAO,CAAC;KAAE;IACjC,CAAC;IACD,OAAO,IAAI,OAAQ,MAAM;GAC1B;GACA,MAAM,QAAQ,YAAY,OAAQ,QAAQ,QAAQ;GAClD,aAAa,OAAQ,OAAO,UAAU,UAAU,OAAO;GACvD,SAAS,QAAQ,gBAAgB;IAChC,iBAAiB,OAAQ,KAAK;GAC/B,CAAC;GACD,MAAM,cAAc;IACnB,UAAU,OAAO;IACjB,MAAM,QAAQ,SAAS,KAAK;IAC5B,aAAa,OAAO,WAAW,MAAM,CAAC,CAAC,OAAO,MAAM,CAAC,CAAC,KAAK;GAC5D;GACA,IAAI,SAAS,QAAQ,gBAAgB;GACrC,MAAM,QAAQ,UAAU,SAAS,QAAA,CAAS,OAAO,SAAS,EAClD,MACR,CAAC;GACD,SAAS,QAAQ,UAAU,KAAK,OAAO;GACvC,UAAU,SAAS;IAClB,aAAa,OAAQ,OAAO,IAAI;IAChC,KAAK,MAAM;GACZ;GAGA,IAAI,CAAC,WAAW,YAAY,SAAS,OAAO,OAAO;EACpD,SAAS,OAAO;GACf,IAAI,SAAS,QAAQ,OAAO,WAAW,CAAC,UAAU;GAClD,gBAAgB,OAAO,OAAO;EAC/B;CACD,CAAC;CACD,MAAM,IAAI,SAAS;EAClB;EACA;EACA,OAAO,WAAW,WAAW;GAC5B,UAAU;IAAE,OAAO;IAAW,OAAO;GAAU;GAC/C,SAAS,OAAO;EACjB;EACA;CACD,CAAC;CACD,QAAQ,iBAAiB,iBAAiB,SAAS,EAAE,MAAM,KAAK,CAAC;CACjE,SAAS,QAAQ,UAAU,OAAO;CAClC,OAAO;AACR"}
1
+ {"version":3,"file":"astro-client.js","names":[],"sources":["../src/astro-client.ts"],"sourcesContent":["import type { RegularAtomFamilyToken } from \"atom.io\"\nimport type { RootStore } from \"atom.io/internal\"\nimport {\n\tcreateRegularAtomFamily,\n\tdisposeFromStore,\n\tfindInStore,\n\tIMPLICIT,\n\tsetIntoStore,\n} from \"atom.io/internal\"\n\nimport { browserApplication } from \"./astro-application.ts\"\nimport { failPreparation, storeContext } from \"./astro-context.ts\"\nimport type { Island } from \"./astro-shared.ts\"\nimport { island, islandStore } from \"./astro-shared.ts\"\nimport { onCleanup, useValue } from \"./core.ts\"\nimport { hydrate, render } from \"./dom.ts\"\n\ntype Props = Record<string, any>\ntype Slots = Record<string, string>\ntype Hydrator = (\n\tcomponent: Island,\n\tprops: Props,\n\tslots: Slots,\n\tmetadata: { client: string },\n) => Promise<void>\nconst roots = new WeakMap<\n\tElement,\n\t{\n\t\tcomponent: Island\n\t\tready: Promise<void>\n\t\tupdate(props: Props, slots: Slots): void\n\t\tdispose(): void\n\t}\n>()\ntype State = { props: Props; slots: Slots }\nconst states = new WeakMap<RootStore, RegularAtomFamilyToken<State, number>>()\nlet serial = 0\n\nexport default (element: HTMLElement): Hydrator =>\n\tasync (component, props, slots, { client }) => {\n\t\tconst previous = roots.get(element)\n\t\tif (previous?.component === component) {\n\t\t\tprevious.update(props, slots)\n\t\t\treturn previous.ready\n\t\t}\n\t\tprevious?.dispose()\n\t\tconst shared = !component.createStore && !component.isolate\n\t\tconst application = shared\n\t\t\t? browserApplication(element.ownerDocument)\n\t\t\t: undefined\n\t\tif (application && client === `only`) application.canResume = false\n\t\tconst lifetime = storeContext(element, application)\n\t\tconst initial = { props, slots }\n\t\tlet current = initial\n\t\tlet update: ((value: State) => void) | undefined\n\t\tlet disposed = false\n\t\tconst dispose = () => {\n\t\t\tif (disposed) return\n\t\t\tdisposed = true\n\t\t\telement.removeEventListener(`astro:unmount`, dispose)\n\t\t\troots.delete(element)\n\t\t\tlifetime.dispose()\n\t\t}\n\t\t// Publish the pending owner before invoking user code. Repeated hydration\n\t\t// calls update its props and share its preparation rather than racing stores.\n\t\tconst ready = Promise.resolve().then(async () => {\n\t\t\tif (lifetime.context.signal.aborted) return\n\t\t\tlet mounting = false\n\t\t\ttry {\n\t\t\t\tconst store = await Promise.race([\n\t\t\t\t\tislandStore(\n\t\t\t\t\t\tcomponent,\n\t\t\t\t\t\tprops,\n\t\t\t\t\t\tlifetime.context,\n\t\t\t\t\t\tshared ? IMPLICIT.STORE : undefined,\n\t\t\t\t\t),\n\t\t\t\t\tlifetime.cancelled,\n\t\t\t\t])\n\t\t\t\tif (lifetime.context.signal.aborted) return\n\t\t\t\tmounting = true\n\t\t\t\tconst replace =\n\t\t\t\t\tclient === `only` ||\n\t\t\t\t\tprevious !== undefined ||\n\t\t\t\t\tapplication?.canResume === false\n\t\t\t\t// Astro leaves this sentinel on islands inserted by ClientRouter.\n\t\t\t\tconst sentinel = element.lastChild\n\t\t\t\tif (sentinel?.nodeType === 8 && sentinel.nodeValue === `astro:end`)\n\t\t\t\t\tsentinel.remove()\n\t\t\t\tlet family = states.get(store!)\n\t\t\t\tif (!family) {\n\t\t\t\t\tfamily = createRegularAtomFamily<State, number, never>(store!, {\n\t\t\t\t\t\tkey: `🔍 spa islands`,\n\t\t\t\t\t\tdefault: { props: {}, slots: {} },\n\t\t\t\t\t})\n\t\t\t\t\tstates.set(store!, family)\n\t\t\t\t}\n\t\t\t\tconst state = findInStore(store!, family, serial++)\n\t\t\t\tsetIntoStore(store!, state, replace ? current : initial)\n\t\t\t\tlifetime.context.onCleanup(() => {\n\t\t\t\t\tdisposeFromStore(store!, state)\n\t\t\t\t})\n\t\t\t\tconst mount = () => {\n\t\t\t\t\tonCleanup(dispose)\n\t\t\t\t\tconst value = useValue(state)\n\t\t\t\t\treturn () => island(component, value().props, value().slots)\n\t\t\t\t}\n\t\t\t\tif (replace) element.replaceChildren()\n\t\t\t\tconst root = (replace ? render : hydrate)(mount, element, {\n\t\t\t\t\tstore: store!,\n\t\t\t\t\tcapabilities: component.capabilities ?? [],\n\t\t\t\t})\n\t\t\t\tlifetime.context.onCleanup(root.dispose)\n\t\t\t\tupdate = (next) => {\n\t\t\t\t\tsetIntoStore(store!, state, next)\n\t\t\t\t\troot.flush()\n\t\t\t\t}\n\t\t\t\t// Match the existing SSR tree before applying a structural prop update\n\t\t\t\t// that arrived while its store was still being prepared.\n\t\t\t\tif (!replace && current !== initial) update(current)\n\t\t\t} catch (error) {\n\t\t\t\tif (lifetime.context.signal.aborted && !mounting) return\n\t\t\t\tfailPreparation(error, dispose)\n\t\t\t}\n\t\t})\n\t\troots.set(element, {\n\t\t\tcomponent,\n\t\t\tready,\n\t\t\tupdate(nextProps, nextSlots) {\n\t\t\t\tcurrent = { props: nextProps, slots: nextSlots }\n\t\t\t\tupdate?.(current)\n\t\t\t},\n\t\t\tdispose,\n\t\t})\n\t\telement.addEventListener(`astro:unmount`, dispose, { once: true })\n\t\tlifetime.context.onCleanup(dispose)\n\t\treturn ready\n\t}\n"],"mappings":";;;;;;;AAyBA,MAAM,wBAAQ,IAAI,QAQhB;AAEF,MAAM,yBAAS,IAAI,QAA0D;AAC7E,IAAI,SAAS;AAEb,IAAA,wBAAgB,YACf,OAAO,WAAW,OAAO,OAAO,EAAE,aAAa;CAC9C,MAAM,WAAW,MAAM,IAAI,OAAO;CAClC,IAAI,UAAU,cAAc,WAAW;EACtC,SAAS,OAAO,OAAO,KAAK;EAC5B,OAAO,SAAS;CACjB;CACA,UAAU,QAAQ;CAClB,MAAM,SAAS,CAAC,UAAU,eAAe,CAAC,UAAU;CACpD,MAAM,cAAc,SACjB,mBAAmB,QAAQ,aAAa,IACxC,KAAA;CACH,IAAI,eAAe,WAAW,QAAQ,YAAY,YAAY;CAC9D,MAAM,WAAW,aAAa,SAAS,WAAW;CAClD,MAAM,UAAU;EAAE;EAAO;CAAM;CAC/B,IAAI,UAAU;CACd,IAAI;CACJ,IAAI,WAAW;CACf,MAAM,gBAAgB;EACrB,IAAI,UAAU;EACd,WAAW;EACX,QAAQ,oBAAoB,iBAAiB,OAAO;EACpD,MAAM,OAAO,OAAO;EACpB,SAAS,QAAQ;CAClB;CAGA,MAAM,QAAQ,QAAQ,QAAQ,CAAC,CAAC,KAAK,YAAY;EAChD,IAAI,SAAS,QAAQ,OAAO,SAAS;EACrC,IAAI,WAAW;EACf,IAAI;GACH,MAAM,QAAQ,MAAM,QAAQ,KAAK,CAChC,YACC,WACA,OACA,SAAS,SACT,SAAS,SAAS,QAAQ,KAAA,CAC3B,GACA,SAAS,SACV,CAAC;GACD,IAAI,SAAS,QAAQ,OAAO,SAAS;GACrC,WAAW;GACX,MAAM,UACL,WAAW,UACX,aAAa,KAAA,KACb,aAAa,cAAc;GAE5B,MAAM,WAAW,QAAQ;GACzB,IAAI,UAAU,aAAa,KAAK,SAAS,cAAc,aACtD,SAAS,OAAO;GACjB,IAAI,SAAS,OAAO,IAAI,KAAM;GAC9B,IAAI,CAAC,QAAQ;IACZ,SAAS,wBAA8C,OAAQ;KAC9D,KAAK;KACL,SAAS;MAAE,OAAO,CAAC;MAAG,OAAO,CAAC;KAAE;IACjC,CAAC;IACD,OAAO,IAAI,OAAQ,MAAM;GAC1B;GACA,MAAM,QAAQ,YAAY,OAAQ,QAAQ,QAAQ;GAClD,aAAa,OAAQ,OAAO,UAAU,UAAU,OAAO;GACvD,SAAS,QAAQ,gBAAgB;IAChC,iBAAiB,OAAQ,KAAK;GAC/B,CAAC;GACD,MAAM,cAAc;IACnB,UAAU,OAAO;IACjB,MAAM,QAAQ,SAAS,KAAK;IAC5B,aAAa,OAAO,WAAW,MAAM,CAAC,CAAC,OAAO,MAAM,CAAC,CAAC,KAAK;GAC5D;GACA,IAAI,SAAS,QAAQ,gBAAgB;GACrC,MAAM,QAAQ,UAAU,SAAS,QAAA,CAAS,OAAO,SAAS;IAClD;IACP,cAAc,UAAU,gBAAgB,CAAC;GAC1C,CAAC;GACD,SAAS,QAAQ,UAAU,KAAK,OAAO;GACvC,UAAU,SAAS;IAClB,aAAa,OAAQ,OAAO,IAAI;IAChC,KAAK,MAAM;GACZ;GAGA,IAAI,CAAC,WAAW,YAAY,SAAS,OAAO,OAAO;EACpD,SAAS,OAAO;GACf,IAAI,SAAS,QAAQ,OAAO,WAAW,CAAC,UAAU;GAClD,gBAAgB,OAAO,OAAO;EAC/B;CACD,CAAC;CACD,MAAM,IAAI,SAAS;EAClB;EACA;EACA,OAAO,WAAW,WAAW;GAC5B,UAAU;IAAE,OAAO;IAAW,OAAO;GAAU;GAC/C,SAAS,OAAO;EACjB;EACA;CACD,CAAC;CACD,QAAQ,iBAAiB,iBAAiB,SAAS,EAAE,MAAM,KAAK,CAAC;CACjE,SAAS,QAAQ,UAAU,OAAO;CAClC,OAAO;AACR"}
@@ -16,7 +16,8 @@ const renderer = {
16
16
  const store = await islandStore(component, props, lifetime.context, shared?.store);
17
17
  return { html: renderToString(() => () => island(component, props, slots), {
18
18
  store,
19
- idPrefix: crypto.randomUUID()
19
+ idPrefix: crypto.randomUUID(),
20
+ capabilities: component.capabilities ?? []
20
21
  }) };
21
22
  } catch (error) {
22
23
  failPreparation(error, lifetime.dispose);
@@ -1 +1 @@
1
- {"version":3,"file":"astro-server.js","names":[],"sources":["../src/astro-server.ts"],"sourcesContent":["/* oxlint-disable typescript/require-await -- Astro requires async renderer callbacks, even for synchronous rendering. */\nimport type { NamedSSRLoadedRendererValue } from \"astro\"\n\nimport { failPreparation, storeContext } from \"./astro-context.ts\"\nimport { requestApplication } from \"./astro-request.ts\"\nimport type { Island } from \"./astro-shared.ts\"\nimport { island, islandStore } from \"./astro-shared.ts\"\nimport { renderToString } from \"./server.ts\"\n\nconst renderer: NamedSSRLoadedRendererValue = {\n\tname: `spa`,\n\tasync check(component: Island) {\n\t\treturn component?.spa === true\n\t},\n\tasync renderToStaticMarkup(component: Island, props, slots) {\n\t\tconst request = (this as unknown as { result?: { request: Request } }).result\n\t\t\t?.request\n\t\tconst shared =\n\t\t\t!component.createStore && !component.isolate && request\n\t\t\t\t? requestApplication(request)\n\t\t\t\t: undefined\n\t\tconst lifetime = storeContext(undefined, shared?.application)\n\t\ttry {\n\t\t\tconst store = await islandStore(\n\t\t\t\tcomponent,\n\t\t\t\tprops,\n\t\t\t\tlifetime.context,\n\t\t\t\tshared?.store,\n\t\t\t)\n\t\t\treturn {\n\t\t\t\thtml: renderToString(() => () => island(component, props, slots), {\n\t\t\t\t\tstore,\n\t\t\t\t\tidPrefix: crypto.randomUUID(),\n\t\t\t\t}),\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tfailPreparation(error, lifetime.dispose)\n\t\t} finally {\n\t\t\tlifetime.dispose()\n\t\t}\n\t},\n}\nexport default renderer\n"],"mappings":";;;;;AASA,MAAM,WAAwC;CAC7C,MAAM;CACN,MAAM,MAAM,WAAmB;EAC9B,OAAO,WAAW,QAAQ;CAC3B;CACA,MAAM,qBAAqB,WAAmB,OAAO,OAAO;EAC3D,MAAM,UAAW,KAAsD,QACpE;EACH,MAAM,SACL,CAAC,UAAU,eAAe,CAAC,UAAU,WAAW,UAC7C,mBAAmB,OAAO,IAC1B,KAAA;EACJ,MAAM,WAAW,aAAa,KAAA,GAAW,QAAQ,WAAW;EAC5D,IAAI;GACH,MAAM,QAAQ,MAAM,YACnB,WACA,OACA,SAAS,SACT,QAAQ,KACT;GACA,OAAO,EACN,MAAM,2BAA2B,OAAO,WAAW,OAAO,KAAK,GAAG;IACjE;IACA,UAAU,OAAO,WAAW;GAC7B,CAAC,EACF;EACD,SAAS,OAAO;GACf,gBAAgB,OAAO,SAAS,OAAO;EACxC,UAAU;GACT,SAAS,QAAQ;EAClB;CACD;AACD"}
1
+ {"version":3,"file":"astro-server.js","names":[],"sources":["../src/astro-server.ts"],"sourcesContent":["/* oxlint-disable typescript/require-await -- Astro requires async renderer callbacks, even for synchronous rendering. */\nimport type { NamedSSRLoadedRendererValue } from \"astro\"\n\nimport { failPreparation, storeContext } from \"./astro-context.ts\"\nimport { requestApplication } from \"./astro-request.ts\"\nimport type { Island } from \"./astro-shared.ts\"\nimport { island, islandStore } from \"./astro-shared.ts\"\nimport { renderToString } from \"./server.ts\"\n\nconst renderer: NamedSSRLoadedRendererValue = {\n\tname: `spa`,\n\tasync check(component: Island) {\n\t\treturn component?.spa === true\n\t},\n\tasync renderToStaticMarkup(component: Island, props, slots) {\n\t\tconst request = (this as unknown as { result?: { request: Request } }).result\n\t\t\t?.request\n\t\tconst shared =\n\t\t\t!component.createStore && !component.isolate && request\n\t\t\t\t? requestApplication(request)\n\t\t\t\t: undefined\n\t\tconst lifetime = storeContext(undefined, shared?.application)\n\t\ttry {\n\t\t\tconst store = await islandStore(\n\t\t\t\tcomponent,\n\t\t\t\tprops,\n\t\t\t\tlifetime.context,\n\t\t\t\tshared?.store,\n\t\t\t)\n\t\t\treturn {\n\t\t\t\thtml: renderToString(() => () => island(component, props, slots), {\n\t\t\t\t\tstore,\n\t\t\t\t\tidPrefix: crypto.randomUUID(),\n\t\t\t\t\tcapabilities: component.capabilities ?? [],\n\t\t\t\t}),\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tfailPreparation(error, lifetime.dispose)\n\t\t} finally {\n\t\t\tlifetime.dispose()\n\t\t}\n\t},\n}\nexport default renderer\n"],"mappings":";;;;;AASA,MAAM,WAAwC;CAC7C,MAAM;CACN,MAAM,MAAM,WAAmB;EAC9B,OAAO,WAAW,QAAQ;CAC3B;CACA,MAAM,qBAAqB,WAAmB,OAAO,OAAO;EAC3D,MAAM,UAAW,KAAsD,QACpE;EACH,MAAM,SACL,CAAC,UAAU,eAAe,CAAC,UAAU,WAAW,UAC7C,mBAAmB,OAAO,IAC1B,KAAA;EACJ,MAAM,WAAW,aAAa,KAAA,GAAW,QAAQ,WAAW;EAC5D,IAAI;GACH,MAAM,QAAQ,MAAM,YACnB,WACA,OACA,SAAS,SACT,QAAQ,KACT;GACA,OAAO,EACN,MAAM,2BAA2B,OAAO,WAAW,OAAO,KAAK,GAAG;IACjE;IACA,UAAU,OAAO,WAAW;IAC5B,cAAc,UAAU,gBAAgB,CAAC;GAC1C,CAAC,EACF;EACD,SAAS,OAAO;GACf,gBAAgB,OAAO,SAAS,OAAO;EACxC,UAAU;GACT,SAAS,QAAQ;EAClB;CACD;AACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"astro-shared-BT45auwR.js","names":[],"sources":["../src/astro-shared.ts"],"sourcesContent":["import type { RootStore } from \"atom.io/internal\"\nimport { IMPLICIT, Store } from \"atom.io/internal\"\n\nimport type { Component, VNode } from \"./core.ts\"\nimport { jsx } from \"./jsx-runtime.ts\"\n\nexport interface AstroApplicationContext {\n\t/** Whether the application still represents its initial server snapshot. */\n\treadonly canResume: boolean\n\treadonly signal: AbortSignal\n\tonCleanup(cleanup: () => void): void\n\t/** Initialize a resource once for this application lifetime. */\n\tget<T>(key: unknown, initialize: () => T): T\n}\nexport interface AstroStoreContext {\n\t/** Shared across default islands; private for explicitly isolated islands. */\n\tapplication: AstroApplicationContext\n\t/** The browser island host; undefined during server rendering. */\n\telement: HTMLElement | undefined\n\t/** Aborted when preparation is cancelled or the island is released. */\n\tsignal: AbortSignal\n\t/** Release resources even if preparation or rendering fails. */\n\tonCleanup(cleanup: () => void): void\n}\nexport type AstroStoreFactory<P = Record<string, any>> = (\n\tprops: P,\n\tcontext: AstroStoreContext,\n) => RootStore | Promise<RootStore>\nexport type AstroStorePreparation<P = Record<string, any>> = (\n\tstore: RootStore,\n\tprops: P,\n\tcontext: AstroStoreContext,\n) => void | Promise<void>\nexport type Island<P = any> = Component<P> & {\n\tspa?: boolean\n\t/** Opt into a private island store instead of the shared application store. */\n\tisolate?: boolean\n\tcreateStore?: AstroStoreFactory<P>\n\tprepareStore?: AstroStorePreparation<P>\n}\nexport async function islandStore(\n\tcomponent: Island,\n\tprops: Record<string, any>,\n\tcontext: AstroStoreContext,\n\tshared?: RootStore,\n): Promise<RootStore> {\n\tconst store = await (component.createStore?.(props, context) ??\n\t\tshared ??\n\t\t(new Store(\n\t\t\t{ name: `spa-island`, lifespan: `ephemeral`, isProduction: true },\n\t\t\tIMPLICIT.STORE,\n\t\t) as RootStore))\n\tcontext.signal.throwIfAborted()\n\tawait component.prepareStore?.(store, props, context)\n\tcontext.signal.throwIfAborted()\n\treturn store\n}\nexport function island(\n\tcomponent: Island,\n\tprops: Record<string, any>,\n\tslots: Record<string, string>,\n): VNode {\n\tconst children = Object.fromEntries(\n\t\tObject.entries(slots).map(([name, html]) => [\n\t\t\tname,\n\t\t\tjsx(`astro-slot`, {\n\t\t\t\tkey: html,\n\t\t\t\tname: name === `default` ? undefined : name,\n\t\t\t\tinnerHTML: html,\n\t\t\t}),\n\t\t]),\n\t)\n\treturn jsx(component, {\n\t\t...props,\n\t\tslots: children,\n\t\tchildren: children[`default`],\n\t})\n}\n"],"mappings":";;;AAwCA,eAAsB,YACrB,WACA,OACA,SACA,QACqB;CACrB,MAAM,QAAQ,OAAO,UAAU,cAAc,OAAO,OAAO,KAC1D,UACC,IAAI,MACJ;EAAE,MAAM;EAAc,UAAU;EAAa,cAAc;CAAK,GAChE,SAAS,KACV;CACD,QAAQ,OAAO,eAAe;CAC9B,MAAM,UAAU,eAAe,OAAO,OAAO,OAAO;CACpD,QAAQ,OAAO,eAAe;CAC9B,OAAO;AACR;AACA,SAAgB,OACf,WACA,OACA,OACQ;CACR,MAAM,WAAW,OAAO,YACvB,OAAO,QAAQ,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,UAAU,CAC3C,MACA,IAAI,cAAc;EACjB,KAAK;EACL,MAAM,SAAS,YAAY,KAAA,IAAY;EACvC,WAAW;CACZ,CAAC,CACF,CAAC,CACF;CACA,OAAO,IAAI,WAAW;EACrB,GAAG;EACH,OAAO;EACP,UAAU,SAAS;CACpB,CAAC;AACF"}
1
+ {"version":3,"file":"astro-shared-BT45auwR.js","names":[],"sources":["../src/astro-shared.ts"],"sourcesContent":["import type { RootStore } from \"atom.io/internal\"\nimport { IMPLICIT, Store } from \"atom.io/internal\"\n\nimport type { Capability } from \"./capabilities.ts\"\nimport type { Component, VNode } from \"./core.ts\"\nimport { jsx } from \"./jsx-runtime.ts\"\n\nexport interface AstroApplicationContext {\n\t/** Whether the application still represents its initial server snapshot. */\n\treadonly canResume: boolean\n\treadonly signal: AbortSignal\n\tonCleanup(cleanup: () => void): void\n\t/** Initialize a resource once for this application lifetime. */\n\tget<T>(key: unknown, initialize: () => T): T\n}\nexport interface AstroStoreContext {\n\t/** Shared across default islands; private for explicitly isolated islands. */\n\tapplication: AstroApplicationContext\n\t/** The browser island host; undefined during server rendering. */\n\telement: HTMLElement | undefined\n\t/** Aborted when preparation is cancelled or the island is released. */\n\tsignal: AbortSignal\n\t/** Release resources even if preparation or rendering fails. */\n\tonCleanup(cleanup: () => void): void\n}\nexport type AstroStoreFactory<P = Record<string, any>> = (\n\tprops: P,\n\tcontext: AstroStoreContext,\n) => RootStore | Promise<RootStore>\nexport type AstroStorePreparation<P = Record<string, any>> = (\n\tstore: RootStore,\n\tprops: P,\n\tcontext: AstroStoreContext,\n) => void | Promise<void>\nexport type Island<P = any> = Component<P> & {\n\tspa?: boolean\n\t/** Capabilities are scoped to this island root on the server and client. */\n\tcapabilities?: readonly Capability[]\n\t/** Opt into a private island store instead of the shared application store. */\n\tisolate?: boolean\n\tcreateStore?: AstroStoreFactory<P>\n\tprepareStore?: AstroStorePreparation<P>\n}\nexport async function islandStore(\n\tcomponent: Island,\n\tprops: Record<string, any>,\n\tcontext: AstroStoreContext,\n\tshared?: RootStore,\n): Promise<RootStore> {\n\tconst store = await (component.createStore?.(props, context) ??\n\t\tshared ??\n\t\t(new Store(\n\t\t\t{ name: `spa-island`, lifespan: `ephemeral`, isProduction: true },\n\t\t\tIMPLICIT.STORE,\n\t\t) as RootStore))\n\tcontext.signal.throwIfAborted()\n\tawait component.prepareStore?.(store, props, context)\n\tcontext.signal.throwIfAborted()\n\treturn store\n}\nexport function island(\n\tcomponent: Island,\n\tprops: Record<string, any>,\n\tslots: Record<string, string>,\n): VNode {\n\tconst children = Object.fromEntries(\n\t\tObject.entries(slots).map(([name, html]) => [\n\t\t\tname,\n\t\t\tjsx(`astro-slot`, {\n\t\t\t\tkey: html,\n\t\t\t\tname: name === `default` ? undefined : name,\n\t\t\t\tinnerHTML: html,\n\t\t\t}),\n\t\t]),\n\t)\n\treturn jsx(component, {\n\t\t...props,\n\t\tslots: children,\n\t\tchildren: children[`default`],\n\t})\n}\n"],"mappings":";;;AA2CA,eAAsB,YACrB,WACA,OACA,SACA,QACqB;CACrB,MAAM,QAAQ,OAAO,UAAU,cAAc,OAAO,OAAO,KAC1D,UACC,IAAI,MACJ;EAAE,MAAM;EAAc,UAAU;EAAa,cAAc;CAAK,GAChE,SAAS,KACV;CACD,QAAQ,OAAO,eAAe;CAC9B,MAAM,UAAU,eAAe,OAAO,OAAO,OAAO;CACpD,QAAQ,OAAO,eAAe;CAC9B,OAAO;AACR;AACA,SAAgB,OACf,WACA,OACA,OACQ;CACR,MAAM,WAAW,OAAO,YACvB,OAAO,QAAQ,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,UAAU,CAC3C,MACA,IAAI,cAAc;EACjB,KAAK;EACL,MAAM,SAAS,YAAY,KAAA,IAAY;EACvC,WAAW;CACZ,CAAC,CACF,CAAC,CACF;CACA,OAAO,IAAI,WAAW;EACrB,GAAG;EACH,OAAO;EACP,UAAU,SAAS;CACpB,CAAC;AACF"}
@@ -1,4 +1,4 @@
1
- import { r as Component } from "./core-BhiA9fFi.js";
1
+ import { o as Component, t as Capability } from "./capabilities-CFP-HIuY.js";
2
2
  import { RootStore } from "atom.io/internal";
3
3
  interface AstroApplicationContext {
4
4
  /** Whether the application still represents its initial server snapshot. */
@@ -22,10 +22,12 @@ type AstroStoreFactory<P = Record<string, any>> = (props: P, context: AstroStore
22
22
  type AstroStorePreparation<P = Record<string, any>> = (store: RootStore, props: P, context: AstroStoreContext) => void | Promise<void>;
23
23
  type Island<P = any> = Component<P> & {
24
24
  spa?: boolean;
25
+ /** Capabilities are scoped to this island root on the server and client. */
26
+ capabilities?: readonly Capability[];
25
27
  /** Opt into a private island store instead of the shared application store. */
26
28
  isolate?: boolean;
27
29
  createStore?: AstroStoreFactory<P>;
28
30
  prepareStore?: AstroStorePreparation<P>;
29
31
  };
30
32
  export { Island as a, AstroStorePreparation as i, AstroStoreContext as n, AstroStoreFactory as r, AstroApplicationContext as t };
31
- //# sourceMappingURL=astro-shared-DkZaqX7L.d.ts.map
33
+ //# sourceMappingURL=astro-shared-BkWvVZWZ.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"astro-shared-BkWvVZWZ.d.ts","names":[],"sources":["../src/astro-shared.ts"],"mappings":";;UAOiB;;WAEP;WACA,QAAQ;EACjB,UAAU;;EAEV,IAAI,GAAG,cAAc,kBAAkB,IAAI;;UAE3B;;EAEhB,aAAa;;EAEb,SAAS;;EAET,QAAQ;;EAER,UAAU;;KAEC,kBAAkB,IAAI,wBACjC,OAAO,GACP,SAAS,sBACL,YAAY,QAAQ;KACb,sBAAsB,IAAI,wBACrC,OAAO,WACP,OAAO,GACP,SAAS,6BACE;KACA,OAAO,WAAW,UAAU;EACvC;;EAEA,wBAAwB;;EAExB;EACA,cAAc,kBAAkB;EAChC,eAAe,sBAAsB"}
package/dist/astro.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { SpaPluginOptions } from "./vite.js";
2
- import { a as Island, i as AstroStorePreparation, n as AstroStoreContext, r as AstroStoreFactory, t as AstroApplicationContext } from "./astro-shared-DkZaqX7L.js";
2
+ import { a as Island, i as AstroStorePreparation, n as AstroStoreContext, r as AstroStoreFactory, t as AstroApplicationContext } from "./astro-shared-BkWvVZWZ.js";
3
3
  import { AstroIntegration } from "astro";
4
4
  export default function integration(options?: SpaPluginOptions): AstroIntegration;
5
5
  export type { AstroApplicationContext, AstroStoreContext, AstroStoreFactory, AstroStorePreparation, Island };
package/dist/astro.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as spa } from "./vite-CQchIQ_-.js";
1
+ import { t as spa } from "./vite-CSHoxzXU.js";
2
2
  // src/astro.ts
3
3
  function integration(options = {}) {
4
4
  return {