@atom.io/spa 0.0.9 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -10
- package/README.mdx +16 -5
- package/dist/BrandMarkScene-BeWazldB.js +140 -0
- package/dist/BrandMarkScene-BeWazldB.js.map +1 -0
- package/dist/astro-application.d.ts +1 -1
- package/dist/astro-application.js +1 -1
- package/dist/astro-client.d.ts +1 -1
- package/dist/astro-client.js +5 -5
- package/dist/{astro-context-OdlexHR4.js → astro-context-B9XKrz8c.js} +1 -1
- package/dist/{astro-context-OdlexHR4.js.map → astro-context-B9XKrz8c.js.map} +1 -1
- package/dist/astro-middleware.js +2 -2
- package/dist/{development/astro-request-DRKvDjsO.js → astro-request-C0eYQlmS.js} +2 -2
- package/dist/{astro-request-DRKvDjsO.js.map → astro-request-C0eYQlmS.js.map} +1 -1
- package/dist/astro-resumability-client.d.ts +1 -1
- package/dist/astro-resumability-client.js +1 -1
- package/dist/astro-resumability-server.js +1 -1
- package/dist/astro-server.js +4 -4
- package/dist/{astro-shared-KxK9OUSj.d.ts → astro-shared-C-iO4PVU.d.ts} +2 -2
- package/dist/{astro-shared-KxK9OUSj.d.ts.map → astro-shared-C-iO4PVU.d.ts.map} +1 -1
- package/dist/{astro-shared-DBwINQav.js → astro-shared-CwBaV3Xu.js} +2 -2
- package/dist/{astro-shared-DBwINQav.js.map → astro-shared-CwBaV3Xu.js.map} +1 -1
- package/dist/astro.d.ts +2 -2
- package/dist/astro.js +1 -1
- package/dist/brand-css.d.ts +2 -0
- package/dist/brand-model.d.ts +32 -0
- package/dist/brand-model.d.ts.map +1 -0
- package/dist/brand-model.js +120 -0
- package/dist/brand-model.js.map +1 -0
- package/dist/brand.css +37 -0
- package/dist/brand.d.ts +13 -0
- package/dist/brand.d.ts.map +1 -0
- package/dist/brand.js +94 -0
- package/dist/brand.js.map +1 -0
- package/dist/{capabilities-ChgSs6bp.d.ts → capabilities-BNnXgvo5.d.ts} +3 -3
- package/dist/{capabilities-ChgSs6bp.d.ts.map → capabilities-BNnXgvo5.d.ts.map} +1 -1
- package/dist/client.min.js +1 -1
- package/dist/{core-DD2giR6E.js → core-N07x1OaR.js} +1 -1
- package/dist/{core-DD2giR6E.js.map → core-N07x1OaR.js.map} +1 -1
- package/dist/development/BrandMarkScene-B282kBA3.js +140 -0
- package/dist/development/BrandMarkScene-B282kBA3.js.map +1 -0
- package/dist/development/astro-application.js +1 -1
- package/dist/development/astro-client.js +5 -5
- package/dist/development/{astro-context-OdlexHR4.js → astro-context-B9XKrz8c.js} +1 -1
- package/dist/development/{astro-context-OdlexHR4.js.map → astro-context-B9XKrz8c.js.map} +1 -1
- package/dist/development/astro-middleware.js +2 -2
- package/dist/{astro-request-DRKvDjsO.js → development/astro-request-C0eYQlmS.js} +2 -2
- package/dist/development/{astro-request-DRKvDjsO.js.map → astro-request-C0eYQlmS.js.map} +1 -1
- package/dist/development/astro-resumability-client.js +1 -1
- package/dist/development/astro-resumability-server.js +1 -1
- package/dist/development/astro-server.js +4 -4
- package/dist/development/{astro-shared-DBwINQav.js → astro-shared-CwBaV3Xu.js} +2 -2
- package/dist/development/{astro-shared-DBwINQav.js.map → astro-shared-CwBaV3Xu.js.map} +1 -1
- package/dist/development/astro.js +1 -1
- package/dist/development/brand-model.js +120 -0
- package/dist/development/brand-model.js.map +1 -0
- package/dist/development/brand.css +37 -0
- package/dist/development/brand.js +94 -0
- package/dist/development/brand.js.map +1 -0
- package/dist/development/{core-DrUd8x25.js → core-D1FWUMMC.js} +1 -1
- package/dist/development/{core-DrUd8x25.js.map → core-D1FWUMMC.js.map} +1 -1
- package/dist/development/{dom-BRFv7FP_.js → dom-C1cVf5Vm.js} +6 -5
- package/dist/development/dom-C1cVf5Vm.js.map +1 -0
- package/dist/development/floating.js +1 -1
- package/dist/development/floating.js.map +1 -1
- package/dist/development/hot.js +3 -3
- package/dist/development/hot.js.map +1 -1
- package/dist/{identity-oFU5p-Qj.js → development/identity-DWHH6jbd.js} +3 -3
- package/dist/development/{identity-DwB8MTM1.js.map → identity-DWHH6jbd.js.map} +1 -1
- package/dist/development/index.js +4 -4
- package/dist/development/{jsx-runtime-BGDPK50B.js → jsx-runtime-B2XxfA3E.js} +1 -1
- package/dist/development/{jsx-runtime-BGDPK50B.js.map → jsx-runtime-B2XxfA3E.js.map} +1 -1
- package/dist/development/jsx-runtime.js +1 -1
- package/dist/development/konva.js +4 -4
- package/dist/development/motion.js +39 -20
- package/dist/development/motion.js.map +1 -1
- package/dist/development/renderer.js +3 -3
- package/dist/{server-renderer-BYFDmqnM.js → development/server-renderer-B-L5tNg7.js} +4 -4
- package/dist/development/{server-renderer-u1-c5PGd.js.map → server-renderer-B-L5tNg7.js.map} +1 -1
- package/dist/development/server.js +1 -1
- package/dist/development/{src-CB7ruwRs.js → src-By4JY4qf.js} +2 -2
- package/dist/development/{src-CB7ruwRs.js.map → src-By4JY4qf.js.map} +1 -1
- package/dist/development/three-F5D1OnE9.js +527 -0
- package/dist/development/three-F5D1OnE9.js.map +1 -0
- package/dist/development/three.js +1 -509
- package/dist/development/{vite-WUiz1ju6.js → vite-BKxEE-ZO.js} +1 -1
- package/dist/development/{vite-WUiz1ju6.js.map → vite-BKxEE-ZO.js.map} +1 -1
- package/dist/development/vite.js +1 -1
- package/dist/{dom--HZvmgqd.js → dom-BbfEAPpR.js} +6 -5
- package/dist/dom-BbfEAPpR.js.map +1 -0
- package/dist/floating.d.ts +1 -1
- package/dist/floating.js +1 -1
- package/dist/floating.js.map +1 -1
- package/dist/hot.d.ts +1 -1
- package/dist/hot.d.ts.map +1 -1
- package/dist/hot.js +1 -1
- package/dist/hot.js.map +1 -1
- package/dist/{development/identity-DwB8MTM1.js → identity-wPtz6EJM.js} +3 -3
- package/dist/{identity-oFU5p-Qj.js.map → identity-wPtz6EJM.js.map} +1 -1
- package/dist/{index-DdA39aMv.d.ts → index-2AKIR8up.d.ts} +4 -4
- package/dist/{index-DdA39aMv.d.ts.map → index-2AKIR8up.d.ts.map} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -4
- package/dist/{jsx-runtime-BGDPK50B.js → jsx-runtime-B2XxfA3E.js} +1 -1
- package/dist/{jsx-runtime-BGDPK50B.js.map → jsx-runtime-B2XxfA3E.js.map} +1 -1
- package/dist/{jsx-runtime-CCvcEosg.d.ts → jsx-runtime-CjiJSx5m.d.ts} +2 -2
- package/dist/{jsx-runtime-CCvcEosg.d.ts.map → jsx-runtime-CjiJSx5m.d.ts.map} +1 -1
- package/dist/jsx-runtime.d.ts +1 -1
- package/dist/jsx-runtime.js +1 -1
- package/dist/konva.d.ts +3 -3
- package/dist/konva.js +4 -4
- package/dist/motion.d.ts +3 -1
- package/dist/motion.d.ts.map +1 -1
- package/dist/motion.js +39 -20
- package/dist/motion.js.map +1 -1
- package/dist/renderer.d.ts +1 -1
- package/dist/renderer.js +3 -3
- package/dist/{development/server-renderer-u1-c5PGd.js → server-renderer-CjTOgG1b.js} +4 -4
- package/dist/{server-renderer-BYFDmqnM.js.map → server-renderer-CjTOgG1b.js.map} +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +1 -1
- package/dist/size.json +13 -13
- package/dist/{src-B2W_TA_X.js → src-BQlLP70K.js} +2 -2
- package/dist/{src-B2W_TA_X.js.map → src-BQlLP70K.js.map} +1 -1
- package/dist/three-DGOOlFXk.js +527 -0
- package/dist/three-DGOOlFXk.js.map +1 -0
- package/dist/three.d.ts +24 -3
- package/dist/three.d.ts.map +1 -1
- package/dist/three.js +1 -509
- package/dist/{vite-WUiz1ju6.js → vite-BKxEE-ZO.js} +1 -1
- package/dist/{vite-WUiz1ju6.js.map → vite-BKxEE-ZO.js.map} +1 -1
- package/dist/vite.js +1 -1
- package/package.json +43 -23
- package/src/BrandMark.module.css +25 -0
- package/src/BrandMark.tsx +106 -0
- package/src/BrandMarkScene.module.css +10 -0
- package/src/BrandMarkScene.tsx +116 -0
- package/src/brand-css.d.ts +2 -0
- package/src/brand-model.ts +177 -0
- package/src/brand.ts +3 -0
- package/src/dom.ts +8 -1
- package/src/hot.ts +3 -2
- package/src/lasertag.d.ts +1 -0
- package/src/motion-layout.ts +55 -26
- package/src/motion.ts +3 -0
- package/src/three.ts +69 -22
- package/dist/development/dom-BRFv7FP_.js.map +0 -1
- package/dist/development/three.js.map +0 -1
- package/dist/dom--HZvmgqd.js.map +0 -1
- package/dist/three.js.map +0 -1
package/README.md
CHANGED
|
@@ -318,6 +318,8 @@ Non-null value and checked props control form state: rejected edits are restored
|
|
|
318
318
|
|
|
319
319
|
Keys accept the same Canonical values as atom.io families, including nested tuples, booleans, and null. Sibling keys must be unique by canonical serialization. A fresh tuple with the same contents preserves the instance, and a number and its string representation identify separate instances. Only undefined uses positional identity. Reordering preserves keyed instances and nodes. Changing a key replaces the instance in both DOM and scene trees, including when the element stands alone.
|
|
320
320
|
|
|
321
|
+
Freezing both a JSX element object and its props opts into reuse in DOM collections without refreshing unchanged descendant props. Its tracked getters remain reactive. Create a new JSX element object when replacing frozen props; the key still preserves the mounted instance. Mutable descriptors continue to refresh when their collection updates.
|
|
322
|
+
|
|
321
323
|
A component can declare a required, narrowed key in its props. The instance receives the original key by reference and can read props.key during setup, rendering, mount, and cleanup. Spreading the props forwards the key to an inner component or element. A spread follows normal JSX precedence, so forwarding the same key to multiple siblings reports a duplicate key.
|
|
322
324
|
|
|
323
325
|
Direct DOM component and root output opt into key tracking when they first mount. Include the key property initially when a direct spread needs later identity changes. An explicit key attribute or a spread containing key with an initial undefined value enables that tracking. Keyless spreads keep their data props live as the instance updates.
|
|
@@ -722,11 +724,11 @@ Sizes are exact minified and level-9 gzip JavaScript byte counts. Declarations,
|
|
|
722
724
|
|
|
723
725
|
| Recipe | Entry | Minified JS | Gzip JS |
|
|
724
726
|
| -------------------------------- | --------------------------------- | ----------: | -------: |
|
|
725
|
-
| Family app with refs and history | `tonnage-recipes/family-app.ts` |
|
|
726
|
-
| Async interactive client app | `tonnage-recipes/async-app.ts` |
|
|
727
|
-
| Interactive client app | `tonnage-recipes/client-app.ts` |
|
|
728
|
-
| Hydrated interactive app | `tonnage-recipes/hydrated-app.ts` |
|
|
729
|
-
| Interactive Astro island | `tonnage-recipes/astro-island.ts` |
|
|
727
|
+
| Family app with refs and history | `tonnage-recipes/family-app.ts` | 70,606 B | 21,473 B |
|
|
728
|
+
| Async interactive client app | `tonnage-recipes/async-app.ts` | 48,653 B | 15,589 B |
|
|
729
|
+
| Interactive client app | `tonnage-recipes/client-app.ts` | 48,325 B | 15,432 B |
|
|
730
|
+
| Hydrated interactive app | `tonnage-recipes/hydrated-app.ts` | 48,326 B | 15,431 B |
|
|
731
|
+
| Interactive Astro island | `tonnage-recipes/astro-island.ts` | 55,273 B | 17,597 B |
|
|
730
732
|
|
|
731
733
|
Report maintained with [tonnage](https://github.com/jeremybanka/tonnage).
|
|
732
734
|
|
|
@@ -779,7 +781,7 @@ Konva owns hit testing, dragging, and draw batching. Write drag results back int
|
|
|
779
781
|
|
|
780
782
|
### Three.js
|
|
781
783
|
|
|
782
|
-
Import Canvas, Group, Mesh, PerspectiveCamera, AmbientLight, DirectionalLight, BoxGeometry, SphereGeometry, PlaneGeometry, MeshStandardMaterial, MeshBasicMaterial, and
|
|
784
|
+
Import Canvas, Group, Mesh, PerspectiveCamera, AmbientLight, DirectionalLight, PointLight, BoxGeometry, SphereGeometry, PlaneGeometry, MeshStandardMaterial, MeshBasicMaterial, MeshNormalMaterial, LineSegments, BufferGeometry, and LineBasicMaterial from @atom.io/spa/three. Canvas creates a WebGL renderer after browser mounting. Geometry and material children attach to their Mesh or LineSegments, with one of each supported. Position and rotation accept three-number tuples; scale also accepts a scalar. Point lights expose color, intensity, distance and decay.
|
|
783
785
|
|
|
784
786
|
```tsx
|
|
785
787
|
import type { SpaElement } from "@atom.io/spa"
|
|
@@ -811,11 +813,11 @@ export function Scene(): SpaElement {
|
|
|
811
813
|
|
|
812
814
|
```
|
|
813
815
|
|
|
814
|
-
Mesh
|
|
816
|
+
Mesh and LineSegments accept optional constructor args typed from Three.js, including custom BufferGeometry and a Material or material array. Resources supplied in args are borrowed: their application owner disposes them after all consumers finish. JSX geometry/material children and implicit drawable defaults remain renderer-owned. Constructor args are fixed for the mounted instance; use a new reconciliation key to replace them.
|
|
815
817
|
|
|
816
818
|
Constructor args are fixed for an instance. Change the resource's key to replace it with new constructor args. 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.
|
|
817
819
|
|
|
818
|
-
Canvas accepts rendererOptions for constructor-time settings such as alpha and powerPreference, or createRenderer to construct the renderer with the supplied canvas. Both paths are exclusively owned by Canvas: it disposes the renderer on removal or setup failure, and the factory must return a renderer using that canvas. Shared/borrowed renderers are not supported by this boundary; use threeRenderer for a separately owned renderer. Options and the factory are captured at mount; replace the keyed Canvas to reconstruct its context.
|
|
820
|
+
Canvas accepts rendererOptions for constructor-time settings such as alpha and powerPreference, or createRenderer to construct the renderer with the supplied canvas. Both paths are exclusively owned by Canvas: it disposes the renderer on removal or setup failure, and the factory must return a renderer using that canvas. Shared/borrowed renderers are not supported by this boundary; use threeRenderer for a separately owned renderer. An optional onError callback handles renderer creation failures locally so an application can offer a fallback; later setup or frame errors still reach the owning error boundary. Options and the factory are captured at mount; replace the keyed Canvas to reconstruct its context.
|
|
819
821
|
|
|
820
822
|
Use onCreated to configure tone mapping, output color space, scene background, or controls after the scene mounts and sizes, before the first draw. Return a cleanup callback for controls or other acquired resources. Numeric dpr selects a fixed positive ratio; a min/max tuple clamps devicePixelRatio and follows window resize events. The default remains 1. Width and height remain reactive positive CSS-pixel dimensions. Canvas updates its default perspective camera projection; supplied cameras are borrowed and retain their own projection. Use onResize to update an external perspective/orthographic camera explicitly. onFrame and pointer routing always use the current camera prop, with one frame loop using the installed Motion clock or requestAnimationFrame.
|
|
821
823
|
|
|
@@ -847,7 +849,25 @@ export function BoardCanvas(): SpaElement {
|
|
|
847
849
|
|
|
848
850
|
```
|
|
849
851
|
|
|
850
|
-
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
|
|
852
|
+
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 by default. A renderWhen predicate can skip idle GPU draws while frame callbacks and pointer updates continue; the caller makes it true when drawing is needed, and Canvas checks it before onFrame. Canvas accepts an onFrame callback with scene, camera, renderer, delta seconds, and timestamp seconds. Controls and asset loading remain application-owned.
|
|
853
|
+
|
|
854
|
+
### Shared brand mark
|
|
855
|
+
|
|
856
|
+
Import BrandMark from @atom.io/spa/brand and its stylesheet from @atom.io/spa/brand/css. The compact mark defaults to 22 CSS pixels; size sets its width and height. Use variant="splash" for the viewport backdrop used on atom.io.fyi. Both variants share the same orbital model and honor reduced motion. Three.js loads after browser mounting; server rendering, unavailable WebGL and failed graphics imports retain the static mark. Install the optional three peer to animate it. The base SPA entrypoint does not include branding or its stylesheet.
|
|
857
|
+
|
|
858
|
+
```tsx
|
|
859
|
+
import "@atom.io/spa/brand/css"
|
|
860
|
+
|
|
861
|
+
import type { SpaElement } from "@atom.io/spa"
|
|
862
|
+
import { BrandMark } from "@atom.io/spa/brand"
|
|
863
|
+
|
|
864
|
+
export function AppBrand(): SpaElement {
|
|
865
|
+
return <BrandMark size={32} />
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
```
|
|
869
|
+
|
|
870
|
+
Contributor tools can import the canonical geometry, camera and lighting helpers from @atom.io/spa/brand/model without importing the component or CSS.
|
|
851
871
|
|
|
852
872
|
### Three.js pointer events
|
|
853
873
|
|
|
@@ -1088,7 +1108,7 @@ export function ReadinessBoard(): SpaElement {
|
|
|
1088
1108
|
|
|
1089
1109
|
motion:layout enables position and size projection; position or size restricts the animated dimensions. motion:layoutId enables layout animation implicitly and carries a visual identity between outgoing/incoming nodes, while reconciliation keys continue to own component instances. Shared identities are isolated by root and by an explicit motion:layoutGroup on each shared node; group is not inherited. Use distinct group values for separate boards in one root. Reusing an ID within a group coordinates a shared transition, with the latest mounted member leading.
|
|
1090
1110
|
|
|
1091
|
-
SPA snapshots registered targets before each synchronous update batch and projects after the DOM commits. Per-target ResizeObserver subscriptions also handle external size changes; no document-wide mutation observer or consumer measurement loop is needed. Mark scrolling layout ancestors with motion:layoutScroll. Nested projections preserve authored transforms and transform origins; Floating UI retains its independent translate positioning. Avoid multiple layout/projection owners or direct writes to a projected element's transform while the capability is active.
|
|
1111
|
+
SPA snapshots registered targets before each synchronous update batch and projects after the DOM commits. Per-target ResizeObserver subscriptions also handle external size changes; no document-wide mutation observer or consumer measurement loop is needed. Mark scrolling layout ancestors with motion:layoutScroll. Mark a movable window or fixed layout ancestor with motion:layoutRoot so it moves immediately while its descendants animate relative to it. Nested projections preserve authored transforms and transform origins; Floating UI retains its independent translate positioning. Avoid multiple layout/projection owners or direct writes to a projected element's transform while the capability is active.
|
|
1092
1112
|
|
|
1093
1113
|
The default transition is a 0.3-second tween; the capability option layoutTransition sets defaults and motion:layoutTransition replaces them for a target. Use finite duration/delay values or settling spring parameters. Retargeting uses the current projection. Outgoing nodes remain available for shared handoff until replacements mount in the same batch. With Motion exits, layout follows the retained node's lifetime; keyed re-entry resumes the existing instance. Shared identity transfers appearance, not component state or DOM ownership, and nodes are not automatically reparented.
|
|
1094
1114
|
|
package/README.mdx
CHANGED
|
@@ -33,6 +33,7 @@ import CreateAstroTemplate from "./exhibits/create-astro-template.sh" with {
|
|
|
33
33
|
};
|
|
34
34
|
import Verify from "./exhibits/verify.sh" with { type: "code" };
|
|
35
35
|
import KonvaExample from "./exhibits/konva.tsx" with { type: "code" };
|
|
36
|
+
import BrandExample from "./exhibits/brand.tsx" with { type: "code" };
|
|
36
37
|
import ThreeExample from "./exhibits/three.tsx" with { type: "code" };
|
|
37
38
|
import MotionPanel from "./exhibits/motion.tsx" with { type: "code" };
|
|
38
39
|
import MotionMain from "./exhibits/motion-main.tsx" with { type: "code" };
|
|
@@ -157,6 +158,8 @@ Non-null value and checked props control form state: rejected edits are restored
|
|
|
157
158
|
|
|
158
159
|
Keys accept the same Canonical values as atom.io families, including nested tuples, booleans, and null. Sibling keys must be unique by canonical serialization. A fresh tuple with the same contents preserves the instance, and a number and its string representation identify separate instances. Only undefined uses positional identity. Reordering preserves keyed instances and nodes. Changing a key replaces the instance in both DOM and scene trees, including when the element stands alone.
|
|
159
160
|
|
|
161
|
+
Freezing both a JSX element object and its props opts into reuse in DOM collections without refreshing unchanged descendant props. Its tracked getters remain reactive. Create a new JSX element object when replacing frozen props; the key still preserves the mounted instance. Mutable descriptors continue to refresh when their collection updates.
|
|
162
|
+
|
|
160
163
|
A component can declare a required, narrowed key in its props. The instance receives the original key by reference and can read props.key during setup, rendering, mount, and cleanup. Spreading the props forwards the key to an inner component or element. A spread follows normal JSX precedence, so forwarding the same key to multiple siblings reports a duplicate key.
|
|
161
164
|
|
|
162
165
|
Direct DOM component and root output opt into key tracking when they first mount. Include the key property initially when a direct spread needs later identity changes. An explicit key attribute or a spread containing key with an initial undefined value enables that tracking. Keyless spreads keep their data props live as the instance updates.
|
|
@@ -287,21 +290,29 @@ Konva owns hit testing, dragging, and draw batching. Write drag results back int
|
|
|
287
290
|
|
|
288
291
|
### Three.js
|
|
289
292
|
|
|
290
|
-
Import Canvas, Group, Mesh, PerspectiveCamera, AmbientLight, DirectionalLight, BoxGeometry, SphereGeometry, PlaneGeometry, MeshStandardMaterial, MeshBasicMaterial, and
|
|
293
|
+
Import Canvas, Group, Mesh, PerspectiveCamera, AmbientLight, DirectionalLight, PointLight, BoxGeometry, SphereGeometry, PlaneGeometry, MeshStandardMaterial, MeshBasicMaterial, MeshNormalMaterial, LineSegments, BufferGeometry, and LineBasicMaterial from @atom.io/spa/three. Canvas creates a WebGL renderer after browser mounting. Geometry and material children attach to their Mesh or LineSegments, with one of each supported. Position and rotation accept three-number tuples; scale also accepts a scalar. Point lights expose color, intensity, distance and decay.
|
|
291
294
|
|
|
292
295
|
<ThreeExample />
|
|
293
296
|
|
|
294
|
-
Mesh
|
|
297
|
+
Mesh and LineSegments accept optional constructor args typed from Three.js, including custom BufferGeometry and a Material or material array. Resources supplied in args are borrowed: their application owner disposes them after all consumers finish. JSX geometry/material children and implicit drawable defaults remain renderer-owned. Constructor args are fixed for the mounted instance; use a new reconciliation key to replace them.
|
|
295
298
|
|
|
296
299
|
Constructor args are fixed for an instance. Change the resource's key to replace it with new constructor args. 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.
|
|
297
300
|
|
|
298
|
-
Canvas accepts rendererOptions for constructor-time settings such as alpha and powerPreference, or createRenderer to construct the renderer with the supplied canvas. Both paths are exclusively owned by Canvas: it disposes the renderer on removal or setup failure, and the factory must return a renderer using that canvas. Shared/borrowed renderers are not supported by this boundary; use threeRenderer for a separately owned renderer. Options and the factory are captured at mount; replace the keyed Canvas to reconstruct its context.
|
|
301
|
+
Canvas accepts rendererOptions for constructor-time settings such as alpha and powerPreference, or createRenderer to construct the renderer with the supplied canvas. Both paths are exclusively owned by Canvas: it disposes the renderer on removal or setup failure, and the factory must return a renderer using that canvas. Shared/borrowed renderers are not supported by this boundary; use threeRenderer for a separately owned renderer. An optional onError callback handles renderer creation failures locally so an application can offer a fallback; later setup or frame errors still reach the owning error boundary. Options and the factory are captured at mount; replace the keyed Canvas to reconstruct its context.
|
|
299
302
|
|
|
300
303
|
Use onCreated to configure tone mapping, output color space, scene background, or controls after the scene mounts and sizes, before the first draw. Return a cleanup callback for controls or other acquired resources. Numeric dpr selects a fixed positive ratio; a min/max tuple clamps devicePixelRatio and follows window resize events. The default remains 1. Width and height remain reactive positive CSS-pixel dimensions. Canvas updates its default perspective camera projection; supplied cameras are borrowed and retain their own projection. Use onResize to update an external perspective/orthographic camera explicitly. onFrame and pointer routing always use the current camera prop, with one frame loop using the installed Motion clock or requestAnimationFrame.
|
|
301
304
|
|
|
302
305
|
<ConfigurableCanvas />
|
|
303
306
|
|
|
304
|
-
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
|
|
307
|
+
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 by default. A renderWhen predicate can skip idle GPU draws while frame callbacks and pointer updates continue; the caller makes it true when drawing is needed, and Canvas checks it before onFrame. Canvas accepts an onFrame callback with scene, camera, renderer, delta seconds, and timestamp seconds. Controls and asset loading remain application-owned.
|
|
308
|
+
|
|
309
|
+
### Shared brand mark
|
|
310
|
+
|
|
311
|
+
Import BrandMark from @atom.io/spa/brand and its stylesheet from @atom.io/spa/brand/css. The compact mark defaults to 22 CSS pixels; size sets its width and height. Use variant="splash" for the viewport backdrop used on atom.io.fyi. Both variants share the same orbital model and honor reduced motion. Three.js loads after browser mounting; server rendering, unavailable WebGL and failed graphics imports retain the static mark. Install the optional three peer to animate it. The base SPA entrypoint does not include branding or its stylesheet.
|
|
312
|
+
|
|
313
|
+
<BrandExample />
|
|
314
|
+
|
|
315
|
+
Contributor tools can import the canonical geometry, camera and lighting helpers from @atom.io/spa/brand/model without importing the component or CSS.
|
|
305
316
|
|
|
306
317
|
### Three.js pointer events
|
|
307
318
|
|
|
@@ -363,7 +374,7 @@ Register motionCapability from @atom.io/spa/motion once to enable animated prope
|
|
|
363
374
|
|
|
364
375
|
motion:layout enables position and size projection; position or size restricts the animated dimensions. motion:layoutId enables layout animation implicitly and carries a visual identity between outgoing/incoming nodes, while reconciliation keys continue to own component instances. Shared identities are isolated by root and by an explicit motion:layoutGroup on each shared node; group is not inherited. Use distinct group values for separate boards in one root. Reusing an ID within a group coordinates a shared transition, with the latest mounted member leading.
|
|
365
376
|
|
|
366
|
-
SPA snapshots registered targets before each synchronous update batch and projects after the DOM commits. Per-target ResizeObserver subscriptions also handle external size changes; no document-wide mutation observer or consumer measurement loop is needed. Mark scrolling layout ancestors with motion:layoutScroll. Nested projections preserve authored transforms and transform origins; Floating UI retains its independent translate positioning. Avoid multiple layout/projection owners or direct writes to a projected element's transform while the capability is active.
|
|
377
|
+
SPA snapshots registered targets before each synchronous update batch and projects after the DOM commits. Per-target ResizeObserver subscriptions also handle external size changes; no document-wide mutation observer or consumer measurement loop is needed. Mark scrolling layout ancestors with motion:layoutScroll. Mark a movable window or fixed layout ancestor with motion:layoutRoot so it moves immediately while its descendants animate relative to it. Nested projections preserve authored transforms and transform origins; Floating UI retains its independent translate positioning. Avoid multiple layout/projection owners or direct writes to a projected element's transform while the capability is active.
|
|
367
378
|
|
|
368
379
|
The default transition is a 0.3-second tween; the capability option layoutTransition sets defaults and motion:layoutTransition replaces them for a target. Use finite duration/delay values or settling spring parameters. Retargeting uses the current projection. Outgoing nodes remain available for shared handoff until replacements mount in the same batch. With Motion exits, layout follows the retained node's lifetime; keyed re-entry resumes the existing instance. Shared identity transfers appearance, not component state or DOM ownership, and nodes are not automatically reparented.
|
|
369
380
|
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { jsx } from "@atom.io/spa/jsx-runtime";
|
|
2
|
+
import { DZ2_ORBITAL_LIGHTS, DZ2_ORBITAL_Y_ROTATION_RADIANS_PER_SECOND, createDz2OrbitalCamera, createDz2OrbitalModel, disposeDz2OrbitalModel } from "./brand-model.js";
|
|
3
|
+
import { f as onMount, u as onCleanup } from "./core-N07x1OaR.js";
|
|
4
|
+
import { h as PointLight, i as Canvas, l as Mesh, o as Group, t as AmbientLight } from "./three-DGOOlFXk.js";
|
|
5
|
+
// src/BrandMarkScene.module.css
|
|
6
|
+
var BrandMarkScene_module_default = { "class": "atom-io-spa-BrandMarkScene-module-class" };
|
|
7
|
+
// src/BrandMarkScene.tsx
|
|
8
|
+
const canvas = { Canvas };
|
|
9
|
+
function BrandMarkScene(props) {
|
|
10
|
+
const view = props.view;
|
|
11
|
+
const camera = createDz2OrbitalCamera();
|
|
12
|
+
const model = createDz2OrbitalModel();
|
|
13
|
+
const mark = () => props.variant === `mark`;
|
|
14
|
+
const narrow = () => view.innerWidth < 680;
|
|
15
|
+
let orbital = null;
|
|
16
|
+
let dirty = true;
|
|
17
|
+
const preference = view.matchMedia(`(prefers-reduced-motion: reduce)`);
|
|
18
|
+
const invalidate = () => {
|
|
19
|
+
dirty = true;
|
|
20
|
+
};
|
|
21
|
+
onMount(() => {
|
|
22
|
+
preference.addEventListener(`change`, invalidate);
|
|
23
|
+
view.document.addEventListener(`visibilitychange`, invalidate);
|
|
24
|
+
onCleanup(() => {
|
|
25
|
+
preference.removeEventListener(`change`, invalidate);
|
|
26
|
+
view.document.removeEventListener(`visibilitychange`, invalidate);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
onCleanup(() => {
|
|
30
|
+
disposeDz2OrbitalModel(model);
|
|
31
|
+
});
|
|
32
|
+
return jsx("brand-mark-scene", {
|
|
33
|
+
get "class"() {
|
|
34
|
+
return BrandMarkScene_module_default[`class`];
|
|
35
|
+
},
|
|
36
|
+
children: jsx(canvas.Canvas, {
|
|
37
|
+
get "camera"() {
|
|
38
|
+
return camera;
|
|
39
|
+
},
|
|
40
|
+
get "width"() {
|
|
41
|
+
return props.width;
|
|
42
|
+
},
|
|
43
|
+
get "height"() {
|
|
44
|
+
return props.height;
|
|
45
|
+
},
|
|
46
|
+
get "dpr"() {
|
|
47
|
+
return Math.min(view.devicePixelRatio || 1, mark() ? 2 : 1.35, mark() ? 1e400 : Math.sqrt(16e6 / (props.width * props.height)));
|
|
48
|
+
},
|
|
49
|
+
get "rendererOptions"() {
|
|
50
|
+
return {
|
|
51
|
+
alpha: true,
|
|
52
|
+
antialias: true,
|
|
53
|
+
powerPreference: mark() ? `low-power` : `high-performance`
|
|
54
|
+
};
|
|
55
|
+
},
|
|
56
|
+
get "onError"() {
|
|
57
|
+
return props.onError;
|
|
58
|
+
},
|
|
59
|
+
"onCreated": (({ scene, renderer }) => {
|
|
60
|
+
renderer.render(scene, camera);
|
|
61
|
+
props.onReady();
|
|
62
|
+
}),
|
|
63
|
+
"onResize": (({ width, height }) => {
|
|
64
|
+
camera.aspect = width / height;
|
|
65
|
+
camera.updateProjectionMatrix();
|
|
66
|
+
invalidate();
|
|
67
|
+
}),
|
|
68
|
+
"renderWhen": (() => !view.document.hidden && (dirty || !preference.matches)),
|
|
69
|
+
"onFrame": (({ delta }) => {
|
|
70
|
+
if (view.document.hidden) return;
|
|
71
|
+
if (!preference.matches) orbital.rotation.y += Math.min(delta, .1) * DZ2_ORBITAL_Y_ROTATION_RADIANS_PER_SECOND;
|
|
72
|
+
dirty = false;
|
|
73
|
+
}),
|
|
74
|
+
children: [
|
|
75
|
+
jsx(AmbientLight, {
|
|
76
|
+
get "color"() {
|
|
77
|
+
return DZ2_ORBITAL_LIGHTS.ambient.color;
|
|
78
|
+
},
|
|
79
|
+
get "intensity"() {
|
|
80
|
+
return DZ2_ORBITAL_LIGHTS.ambient.intensity;
|
|
81
|
+
}
|
|
82
|
+
}),
|
|
83
|
+
jsx(PointLight, {
|
|
84
|
+
get "color"() {
|
|
85
|
+
return DZ2_ORBITAL_LIGHTS.core.color;
|
|
86
|
+
},
|
|
87
|
+
get "intensity"() {
|
|
88
|
+
return DZ2_ORBITAL_LIGHTS.core.intensity;
|
|
89
|
+
},
|
|
90
|
+
get "distance"() {
|
|
91
|
+
return DZ2_ORBITAL_LIGHTS.core.distance;
|
|
92
|
+
},
|
|
93
|
+
get "position"() {
|
|
94
|
+
return DZ2_ORBITAL_LIGHTS.core.position;
|
|
95
|
+
}
|
|
96
|
+
}),
|
|
97
|
+
jsx(Group, {
|
|
98
|
+
get "scale"() {
|
|
99
|
+
return mark() ? 1.25 : narrow() ? .52 : .72;
|
|
100
|
+
},
|
|
101
|
+
get "position"() {
|
|
102
|
+
return [
|
|
103
|
+
0,
|
|
104
|
+
!mark() && narrow() ? -.08 : 0,
|
|
105
|
+
0
|
|
106
|
+
];
|
|
107
|
+
},
|
|
108
|
+
"ref": ((node) => {
|
|
109
|
+
orbital = node;
|
|
110
|
+
if (node) node.rotation.copy(model.orbital.rotation);
|
|
111
|
+
}),
|
|
112
|
+
get children() {
|
|
113
|
+
return model.meshes.map((mesh, index) => jsx(Mesh, {
|
|
114
|
+
get "key"() {
|
|
115
|
+
return index;
|
|
116
|
+
},
|
|
117
|
+
get "args"() {
|
|
118
|
+
return [mesh.geometry, mesh.material];
|
|
119
|
+
},
|
|
120
|
+
get "position"() {
|
|
121
|
+
return mesh.position.toArray();
|
|
122
|
+
},
|
|
123
|
+
get "rotation"() {
|
|
124
|
+
return [
|
|
125
|
+
mesh.rotation.x,
|
|
126
|
+
mesh.rotation.y,
|
|
127
|
+
mesh.rotation.z
|
|
128
|
+
];
|
|
129
|
+
}
|
|
130
|
+
}));
|
|
131
|
+
}
|
|
132
|
+
})
|
|
133
|
+
]
|
|
134
|
+
})
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
BrandMarkScene.spa = true;
|
|
138
|
+
export { BrandMarkScene };
|
|
139
|
+
|
|
140
|
+
//# sourceMappingURL=BrandMarkScene-BeWazldB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrandMarkScene-BeWazldB.js","names":["_spa","css"],"sources":["../src/BrandMarkScene.tsx"],"sourcesContent":["/** @jsxImportSource @atom.io/spa */\nimport type * as THREE from \"three\"\n\nimport {\n\tcreateDz2OrbitalCamera,\n\tcreateDz2OrbitalModel,\n\tdisposeDz2OrbitalModel,\n\tDZ2_ORBITAL_LIGHTS,\n\tDZ2_ORBITAL_Y_ROTATION_RADIANS_PER_SECOND,\n} from \"./brand-model.ts\"\nimport css from \"./BrandMarkScene.module.css\"\nimport type { SpaElement } from \"./core.ts\"\nimport { onCleanup, onMount } from \"./core.ts\"\nimport { AmbientLight, Canvas, Group, Mesh, PointLight } from \"./three.ts\"\n\nconst canvas = { Canvas }\nexport function BrandMarkScene(props: {\n\tvariant: `mark` | `splash`\n\twidth: number\n\theight: number\n\tview: Window\n\tonReady(): void\n\tonError(error: unknown): void\n}): SpaElement {\n\tconst view = props.view\n\tconst camera = createDz2OrbitalCamera()\n\tconst model = createDz2OrbitalModel()\n\tconst mark = () => props.variant === `mark`\n\tconst narrow = () => view.innerWidth < 680\n\tlet orbital: THREE.Object3D | null = null\n\tlet dirty = true\n\tconst preference = view.matchMedia(`(prefers-reduced-motion: reduce)`)\n\tconst invalidate = () => {\n\t\tdirty = true\n\t}\n\tonMount(() => {\n\t\tpreference.addEventListener(`change`, invalidate)\n\t\tview.document.addEventListener(`visibilitychange`, invalidate)\n\t\tonCleanup(() => {\n\t\t\tpreference.removeEventListener(`change`, invalidate)\n\t\t\tview.document.removeEventListener(`visibilitychange`, invalidate)\n\t\t})\n\t})\n\tonCleanup(() => {\n\t\tdisposeDz2OrbitalModel(model)\n\t})\n\treturn (\n\t\t<brand-mark-scene class={css[`class`]}>\n\t\t\t<canvas.Canvas\n\t\t\t\tcamera={camera}\n\t\t\t\twidth={props.width}\n\t\t\t\theight={props.height}\n\t\t\t\tdpr={Math.min(\n\t\t\t\t\tview.devicePixelRatio || 1,\n\t\t\t\t\tmark() ? 2 : 1.35,\n\t\t\t\t\tmark()\n\t\t\t\t\t\t? Infinity\n\t\t\t\t\t\t: Math.sqrt(16_000_000 / (props.width * props.height)),\n\t\t\t\t)}\n\t\t\t\trendererOptions={{\n\t\t\t\t\talpha: true,\n\t\t\t\t\tantialias: true,\n\t\t\t\t\tpowerPreference: mark() ? `low-power` : `high-performance`,\n\t\t\t\t}}\n\t\t\t\tonError={props.onError}\n\t\t\t\tonCreated={({ scene, renderer }) => {\n\t\t\t\t\trenderer.render(scene, camera)\n\t\t\t\t\tprops.onReady()\n\t\t\t\t}}\n\t\t\t\tonResize={({ width, height }) => {\n\t\t\t\t\tcamera.aspect = width / height\n\t\t\t\t\tcamera.updateProjectionMatrix()\n\t\t\t\t\tinvalidate()\n\t\t\t\t}}\n\t\t\t\trenderWhen={() =>\n\t\t\t\t\t!view.document.hidden && (dirty || !preference.matches)\n\t\t\t\t}\n\t\t\t\tonFrame={({ delta }) => {\n\t\t\t\t\tif (view.document.hidden) return\n\t\t\t\t\tif (!preference.matches)\n\t\t\t\t\t\torbital!.rotation.y +=\n\t\t\t\t\t\t\tMath.min(delta, 0.1) * DZ2_ORBITAL_Y_ROTATION_RADIANS_PER_SECOND\n\t\t\t\t\tdirty = false\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<AmbientLight\n\t\t\t\t\tcolor={DZ2_ORBITAL_LIGHTS.ambient.color}\n\t\t\t\t\tintensity={DZ2_ORBITAL_LIGHTS.ambient.intensity}\n\t\t\t\t/>\n\t\t\t\t<PointLight\n\t\t\t\t\tcolor={DZ2_ORBITAL_LIGHTS.core.color}\n\t\t\t\t\tintensity={DZ2_ORBITAL_LIGHTS.core.intensity}\n\t\t\t\t\tdistance={DZ2_ORBITAL_LIGHTS.core.distance}\n\t\t\t\t\tposition={DZ2_ORBITAL_LIGHTS.core.position}\n\t\t\t\t/>\n\t\t\t\t<Group\n\t\t\t\t\tscale={mark() ? 1.25 : narrow() ? 0.52 : 0.72}\n\t\t\t\t\tposition={[0, !mark() && narrow() ? -0.08 : 0, 0]}\n\t\t\t\t\tref={(node) => {\n\t\t\t\t\t\torbital = node\n\t\t\t\t\t\tif (node) node.rotation.copy(model.orbital.rotation)\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{model.meshes.map((mesh, index) => (\n\t\t\t\t\t\t<Mesh\n\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\targs={[mesh.geometry, mesh.material]}\n\t\t\t\t\t\t\tposition={mesh.position.toArray()}\n\t\t\t\t\t\t\trotation={[mesh.rotation.x, mesh.rotation.y, mesh.rotation.z]}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</Group>\n\t\t\t</canvas.Canvas>\n\t\t</brand-mark-scene>\n\t)\n}\n"],"mappings":";;;;;;;AAeA,MAAM,SAAS,EAAE,OAAO;AACxB,SAAgB,eAAe,OAOhB;CACd,MAAM,OAAO,MAAM;CACnB,MAAM,SAAS,uBAAuB;CACtC,MAAM,QAAQ,sBAAsB;CACpC,MAAM,aAAa,MAAM,YAAY;CACrC,MAAM,eAAe,KAAK,aAAa;CACvC,IAAI,UAAiC;CACrC,IAAI,QAAQ;CACZ,MAAM,aAAa,KAAK,WAAW,kCAAkC;CACrE,MAAM,mBAAmB;EACxB,QAAQ;CACT;CACA,cAAc;EACb,WAAW,iBAAiB,UAAU,UAAU;EAChD,KAAK,SAAS,iBAAiB,oBAAoB,UAAU;EAC7D,gBAAgB;GACf,WAAW,oBAAoB,UAAU,UAAU;GACnD,KAAK,SAAS,oBAAoB,oBAAoB,UAAU;EACjE,CAAC;CACF,CAAC;CACD,gBAAgB;EACf,uBAAuB,KAAK;CAC7B,CAAC;CACD,OACCA,IAAA,oBAAA;EAAA,IAAA,UAAA;GAAA,OAAyBC,8BAAI;EAAQ;EAAA,UACpCD,IAAA,OAAA,QAAA;GAAA,IAAA,WAAA;IAAA,OACS;GAAM;GAAA,IAAA,UAAA;IAAA,OACP,MAAM;GAAK;GAAA,IAAA,WAAA;IAAA,OACV,MAAM;GAAM;GAAA,IAAA,QAAA;IAAA,OACf,KAAK,IACT,KAAK,oBAAoB,GACzB,KAAK,IAAI,IAAI,MACb,KAAK,IACF,QACA,KAAK,KAAK,QAAc,MAAM,QAAQ,MAAM,OAAO,CACvD;GAAC;GAAA,IAAA,oBAAA;IAAA,OACgB;KAChB,OAAO;KACP,WAAW;KACX,iBAAiB,KAAK,IAAI,cAAc;IACzC;GAAC;GAAA,IAAA,YAAA;IAAA,OACQ,MAAM;GAAO;GAAA,eACV,EAAE,OAAO,eAAe;IACnC,SAAS,OAAO,OAAO,MAAM;IAC7B,MAAM,QAAQ;GACf;GAAC,cACU,EAAE,OAAO,aAAa;IAChC,OAAO,SAAS,QAAQ;IACxB,OAAO,uBAAuB;IAC9B,WAAW;GACZ;GAAC,qBAEA,CAAC,KAAK,SAAS,WAAW,SAAS,CAAC,WAAW;GAAQ,aAE9C,EAAE,YAAY;IACvB,IAAI,KAAK,SAAS,QAAQ;IAC1B,IAAI,CAAC,WAAW,SACf,QAAS,SAAS,KACjB,KAAK,IAAI,OAAO,EAAG,IAAI;IACzB,QAAQ;GACT;GAAC,UAAA;IAEDA,IAAA,cAAA;KAAA,IAAA,UAAA;MAAA,OACQ,mBAAmB,QAAQ;KAAK;KAAA,IAAA,cAAA;MAAA,OAC5B,mBAAmB,QAAQ;KAAS;IAAA,CAAA;IAEhDA,IAAA,YAAA;KAAA,IAAA,UAAA;MAAA,OACQ,mBAAmB,KAAK;KAAK;KAAA,IAAA,cAAA;MAAA,OACzB,mBAAmB,KAAK;KAAS;KAAA,IAAA,aAAA;MAAA,OAClC,mBAAmB,KAAK;KAAQ;KAAA,IAAA,aAAA;MAAA,OAChC,mBAAmB,KAAK;KAAQ;IAAA,CAAA;IAE3CA,IAAA,OAAA;KAAA,IAAA,UAAA;MAAA,OACQ,KAAK,IAAI,OAAO,OAAO,IAAI,MAAO;KAAI;KAAA,IAAA,aAAA;MAAA,OACnC;OAAC;OAAG,CAAC,KAAK,KAAK,OAAO,IAAI,OAAQ;OAAG;MAAC;KAAC;KAAA,SAC3C,SAAS;MACd,UAAU;MACV,IAAI,MAAM,KAAK,SAAS,KAAK,MAAM,QAAQ,QAAQ;KACpD;KAAC,IAAA,WAAA;MAAA,OAEA,MAAM,OAAO,KAAK,MAAM,UACxBA,IAAA,MAAA;OAAA,IAAA,QAAA;QAAA,OACM;OAAK;OAAA,IAAA,SAAA;QAAA,OACJ,CAAC,KAAK,UAAU,KAAK,QAAQ;OAAC;OAAA,IAAA,aAAA;QAAA,OAC1B,KAAK,SAAS,QAAQ;OAAC;OAAA,IAAA,aAAA;QAAA,OACvB;SAAC,KAAK,SAAS;SAAG,KAAK,SAAS;SAAG,KAAK,SAAS;QAAC;OAAC;MAAA,CAAA,CAE9D;KAAC;IAAA,CAAA;GACK;EAAA,CAAA;CACO,CAAA;AAGnB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as applicationContext } from "./astro-context-OdlexHR4.js";
|
|
2
1
|
import { IMPLICIT, subscribeToStateSubject, withdraw } from "atom.io/internal";
|
|
2
|
+
import { t as applicationContext } from "./astro-context-B9XKrz8c.js";
|
|
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. */
|
package/dist/astro-client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as Island, i as AstroStorePreparation } from "./astro-shared-
|
|
1
|
+
import { a as Island, i as AstroStorePreparation } from "./astro-shared-C-iO4PVU.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: {
|
package/dist/astro-client.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { IMPLICIT, createRegularAtomFamily, disposeFromStore, findInStore, getFromStore, setIntoStore } from "atom.io/internal";
|
|
1
2
|
import { browserApplication } from "./astro-application.js";
|
|
2
|
-
import { n as failPreparation, r as storeContext } from "./astro-context-
|
|
3
|
-
import { n as islandStore, t as island } from "./astro-shared-
|
|
4
|
-
import { b as useGetter } from "./core-
|
|
5
|
-
import { n as render, t as hydrate } from "./dom
|
|
3
|
+
import { n as failPreparation, r as storeContext } from "./astro-context-B9XKrz8c.js";
|
|
4
|
+
import { n as islandStore, t as island } from "./astro-shared-CwBaV3Xu.js";
|
|
5
|
+
import { b as useGetter } from "./core-N07x1OaR.js";
|
|
6
|
+
import { n as render, t as hydrate } from "./dom-BbfEAPpR.js";
|
|
6
7
|
import { onRootDispose } from "./hot.js";
|
|
7
|
-
import { IMPLICIT, createRegularAtomFamily, disposeFromStore, findInStore, getFromStore, setIntoStore } from "atom.io/internal";
|
|
8
8
|
// src/astro-client.ts
|
|
9
9
|
const roots = /* @__PURE__ */ new WeakMap();
|
|
10
10
|
const states = /* @__PURE__ */ new WeakMap();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"astro-context-
|
|
1
|
+
{"version":3,"file":"astro-context-B9XKrz8c.js","names":[],"sources":["../src/astro-context.ts"],"sourcesContent":["import type {\n\tAstroApplicationContext,\n\tAstroStoreContext,\n} from \"./astro-shared.ts\"\n\ntype Lifetime = {\n\tsignal: AbortSignal\n\tonCleanup(cleanup: () => void): () => void\n\tdispose(): void\n\tcancelled: Promise<undefined>\n}\n\nfunction lifetime(): Lifetime {\n\tconst controller = new AbortController()\n\tconst cleanups = new Set<() => void>()\n\tlet cancel!: () => void\n\tconst cancelled = new Promise<undefined>((resolve) => {\n\t\tcancel = () => {\n\t\t\tresolve(undefined)\n\t\t}\n\t})\n\treturn {\n\t\tsignal: controller.signal,\n\t\tonCleanup(cleanup) {\n\t\t\tif (controller.signal.aborted) cleanup()\n\t\t\telse cleanups.add(cleanup)\n\t\t\treturn () => {\n\t\t\t\tcleanups.delete(cleanup)\n\t\t\t}\n\t\t},\n\t\tcancelled,\n\t\tdispose() {\n\t\t\tif (controller.signal.aborted) return\n\t\t\tcontroller.abort()\n\t\t\tcancel()\n\t\t\tconst errors: unknown[] = []\n\t\t\tfor (const cleanup of [...cleanups].reverse()) {\n\t\t\t\ttry {\n\t\t\t\t\tcleanup()\n\t\t\t\t} catch (error) {\n\t\t\t\t\terrors.push(error)\n\t\t\t\t}\n\t\t\t}\n\t\t\tcleanups.clear()\n\t\t\tif (errors.length)\n\t\t\t\tthrow new AggregateError(errors, `spa: Astro store cleanup failed`)\n\t\t},\n\t}\n}\n\nexport type Application = Lifetime &\n\tAstroApplicationContext & { canResume: boolean }\nexport function applicationContext(): Application {\n\tconst life = lifetime()\n\tconst resources = new Map<unknown, unknown>()\n\tlife.onCleanup(() => {\n\t\tresources.clear()\n\t})\n\treturn {\n\t\t...life,\n\t\tcanResume: true,\n\t\tget<T>(key: unknown, initialize: () => T): T {\n\t\t\tlife.signal.throwIfAborted()\n\t\t\tif (!resources.has(key)) resources.set(key, initialize())\n\t\t\treturn resources.get(key) as T\n\t\t},\n\t}\n}\n\n/** Island resources and shared application resources have distinct owners. */\nexport function storeContext(\n\telement?: HTMLElement,\n\tshared?: ReturnType<typeof applicationContext>,\n): {\n\tcontext: AstroStoreContext\n\tdispose(): void\n\tcancelled: Promise<undefined>\n} {\n\tconst life = lifetime()\n\tconst application = shared ?? applicationContext()\n\tif (shared) life.onCleanup(shared.onCleanup(life.dispose))\n\telse life.onCleanup(application.dispose)\n\treturn {\n\t\tcontext: {\n\t\t\telement,\n\t\t\tsignal: life.signal,\n\t\t\tonCleanup: life.onCleanup,\n\t\t\tapplication,\n\t\t},\n\t\tdispose: life.dispose,\n\t\tcancelled: life.cancelled,\n\t}\n}\n\nexport function failPreparation(error: unknown, dispose: () => void): never {\n\ttry {\n\t\tdispose()\n\t} catch (cleanup) {\n\t\tthrow new AggregateError([error, cleanup])\n\t}\n\tthrow error\n}\n"],"mappings":";AAYA,SAAS,WAAqB;CAC7B,MAAM,aAAa,IAAI,gBAAgB;CACvC,MAAM,2BAAW,IAAI,IAAgB;CACrC,IAAI;CACJ,MAAM,YAAY,IAAI,SAAoB,YAAY;EACrD,eAAe;GACd,QAAQ,KAAA,CAAS;EAClB;CACD,CAAC;CACD,OAAO;EACN,QAAQ,WAAW;EACnB,UAAU,SAAS;GAClB,IAAI,WAAW,OAAO,SAAS,QAAQ;QAClC,SAAS,IAAI,OAAO;GACzB,aAAa;IACZ,SAAS,OAAO,OAAO;GACxB;EACD;EACA;EACA,UAAU;GACT,IAAI,WAAW,OAAO,SAAS;GAC/B,WAAW,MAAM;GACjB,OAAO;GACP,MAAM,SAAoB,CAAC;GAC3B,KAAK,MAAM,WAAW,CAAC,GAAG,QAAQ,CAAC,CAAC,QAAQ,GAC3C,IAAI;IACH,QAAQ;GACT,SAAS,OAAO;IACf,OAAO,KAAK,KAAK;GAClB;GAED,SAAS,MAAM;GACf,IAAI,OAAO,QACV,MAAM,IAAI,eAAe,QAAQ,iCAAiC;EACpE;CACD;AACD;AAIA,SAAgB,qBAAkC;CACjD,MAAM,OAAO,SAAS;CACtB,MAAM,4BAAY,IAAI,IAAsB;CAC5C,KAAK,gBAAgB;EACpB,UAAU,MAAM;CACjB,CAAC;CACD,OAAO;EACN,GAAG;EACH,WAAW;EACX,IAAO,KAAc,YAAwB;GAC5C,KAAK,OAAO,eAAe;GAC3B,IAAI,CAAC,UAAU,IAAI,GAAG,GAAG,UAAU,IAAI,KAAK,WAAW,CAAC;GACxD,OAAO,UAAU,IAAI,GAAG;EACzB;CACD;AACD;;AAGA,SAAgB,aACf,SACA,QAKC;CACD,MAAM,OAAO,SAAS;CACtB,MAAM,cAAc,UAAU,mBAAmB;CACjD,IAAI,QAAQ,KAAK,UAAU,OAAO,UAAU,KAAK,OAAO,CAAC;MACpD,KAAK,UAAU,YAAY,OAAO;CACvC,OAAO;EACN,SAAS;GACR;GACA,QAAQ,KAAK;GACb,WAAW,KAAK;GAChB;EACD;EACA,SAAS,KAAK;EACd,WAAW,KAAK;CACjB;AACD;AAEA,SAAgB,gBAAgB,OAAgB,SAA4B;CAC3E,IAAI;EACH,QAAQ;CACT,SAAS,SAAS;EACjB,MAAM,IAAI,eAAe,CAAC,OAAO,OAAO,CAAC;CAC1C;CACA,MAAM;AACP"}
|
package/dist/astro-middleware.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as failPreparation } from "./astro-context-
|
|
2
|
-
import { t as requestApplication } from "./astro-request-
|
|
1
|
+
import { n as failPreparation } from "./astro-context-B9XKrz8c.js";
|
|
2
|
+
import { t as requestApplication } from "./astro-request-C0eYQlmS.js";
|
|
3
3
|
// src/astro-middleware.ts
|
|
4
4
|
/** Keep request resources alive until the streamed response is finished. */
|
|
5
5
|
const onRequest = async ({ request }, next) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as applicationContext } from "./astro-context-OdlexHR4.js";
|
|
2
1
|
import { IMPLICIT, Store } from "atom.io/internal";
|
|
2
|
+
import { t as applicationContext } from "./astro-context-B9XKrz8c.js";
|
|
3
3
|
// src/astro-request.ts
|
|
4
4
|
const requests = /* @__PURE__ */ new WeakMap();
|
|
5
5
|
function createRequest() {
|
|
@@ -67,4 +67,4 @@ function syncDefinitions(store) {
|
|
|
67
67
|
}
|
|
68
68
|
export { requestApplication as t };
|
|
69
69
|
|
|
70
|
-
//# sourceMappingURL=astro-request-
|
|
70
|
+
//# sourceMappingURL=astro-request-C0eYQlmS.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"astro-request-
|
|
1
|
+
{"version":3,"file":"astro-request-C0eYQlmS.js","names":[],"sources":["../src/astro-request.ts"],"sourcesContent":["import type { RootStore } from \"atom.io/internal\"\nimport { IMPLICIT, Store } from \"atom.io/internal\"\n\nimport { applicationContext } from \"./astro-context.ts\"\n\nconst requests = new WeakMap<Request, ReturnType<typeof createRequest>>()\nfunction createRequest() {\n\tconst application = applicationContext()\n\tlet store: RootStore | undefined\n\treturn {\n\t\tapplication,\n\t\tget store(): RootStore {\n\t\t\tapplication.signal.throwIfAborted()\n\t\t\tif (!store) {\n\t\t\t\tstore = new Store(\n\t\t\t\t\t{ name: `spa-request`, lifespan: `ephemeral`, isProduction: true },\n\t\t\t\t\tIMPLICIT.STORE,\n\t\t\t\t) as RootStore\n\t\t\t\tconst selected = store\n\t\t\t\tapplication.onCleanup(() => {\n\t\t\t\t\tconst errors: unknown[] = []\n\t\t\t\t\tfor (const state of selected.atoms.values()) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tstate.cleanup?.()\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\terrors.push(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor (const resource of selected.miscResources.values()) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresource[Symbol.dispose]()\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\terrors.push(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (errors.length)\n\t\t\t\t\t\tthrow new AggregateError(errors, `spa: request cleanup failed`)\n\t\t\t\t})\n\t\t\t}\n\t\t\tsyncDefinitions(store)\n\t\t\treturn store\n\t\t},\n\t}\n}\nexport function requestApplication(\n\trequest: Request,\n): ReturnType<typeof createRequest> {\n\tlet app = requests.get(request)\n\tif (!app) {\n\t\tapp = createRequest()\n\t\trequests.set(request, app)\n\t\tconst dispose = () => {\n\t\t\tapp!.application.dispose()\n\t\t}\n\t\trequest.signal.addEventListener(`abort`, dispose, { once: true })\n\t\tapp.application.onCleanup(() => {\n\t\t\trequest.signal.removeEventListener(`abort`, dispose)\n\t\t})\n\t\tif (request.signal.aborted) dispose()\n\t}\n\treturn app\n}\n/** Install definitions imported after an earlier island started this request. */\nfunction syncDefinitions(store: RootStore): void {\n\tconst source = IMPLICIT.STORE\n\tfor (const field of [\n\t\t`families`,\n\t\t`atoms`,\n\t\t`readonlySelectors`,\n\t\t`writableSelectors`,\n\t\t`transactions`,\n\t\t`timelineFamilies`,\n\t\t`timelines`,\n\t] as const) {\n\t\tfor (const [key, resource] of source[field]) {\n\t\t\tif (!store[field].has(key)) resource.install(store)\n\t\t}\n\t}\n}\n"],"mappings":";;;AAKA,MAAM,2BAAW,IAAI,QAAmD;AACxE,SAAS,gBAAgB;CACxB,MAAM,cAAc,mBAAmB;CACvC,IAAI;CACJ,OAAO;EACN;EACA,IAAI,QAAmB;GACtB,YAAY,OAAO,eAAe;GAClC,IAAI,CAAC,OAAO;IACX,QAAQ,IAAI,MACX;KAAE,MAAM;KAAe,UAAU;KAAa,cAAc;IAAK,GACjE,SAAS,KACV;IACA,MAAM,WAAW;IACjB,YAAY,gBAAgB;KAC3B,MAAM,SAAoB,CAAC;KAC3B,KAAK,MAAM,SAAS,SAAS,MAAM,OAAO,GACzC,IAAI;MACH,MAAM,UAAU;KACjB,SAAS,OAAO;MACf,OAAO,KAAK,KAAK;KAClB;KAED,KAAK,MAAM,YAAY,SAAS,cAAc,OAAO,GACpD,IAAI;MACH,SAAS,OAAO,QAAQ,CAAC;KAC1B,SAAS,OAAO;MACf,OAAO,KAAK,KAAK;KAClB;KAED,IAAI,OAAO,QACV,MAAM,IAAI,eAAe,QAAQ,6BAA6B;IAChE,CAAC;GACF;GACA,gBAAgB,KAAK;GACrB,OAAO;EACR;CACD;AACD;AACA,SAAgB,mBACf,SACmC;CACnC,IAAI,MAAM,SAAS,IAAI,OAAO;CAC9B,IAAI,CAAC,KAAK;EACT,MAAM,cAAc;EACpB,SAAS,IAAI,SAAS,GAAG;EACzB,MAAM,gBAAgB;GACrB,IAAK,YAAY,QAAQ;EAC1B;EACA,QAAQ,OAAO,iBAAiB,SAAS,SAAS,EAAE,MAAM,KAAK,CAAC;EAChE,IAAI,YAAY,gBAAgB;GAC/B,QAAQ,OAAO,oBAAoB,SAAS,OAAO;EACpD,CAAC;EACD,IAAI,QAAQ,OAAO,SAAS,QAAQ;CACrC;CACA,OAAO;AACR;;AAEA,SAAS,gBAAgB,OAAwB;CAChD,MAAM,SAAS,SAAS;CACxB,KAAK,MAAM,SAAS;EACnB;EACA;EACA;EACA;EACA;EACA;EACA;CACD,GACC,KAAK,MAAM,CAAC,KAAK,aAAa,OAAO,QACpC,IAAI,CAAC,MAAM,MAAM,CAAC,IAAI,GAAG,GAAG,SAAS,QAAQ,KAAK;AAGrD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { browserResumption, captureElement, createResumption } from "resumability/astro-client";
|
|
1
2
|
import { browserApplication } from "./astro-application.js";
|
|
2
3
|
import { createHydrator } from "./astro-client.js";
|
|
3
|
-
import { browserResumption, captureElement, createResumption } from "resumability/astro-client";
|
|
4
4
|
// src/astro-resumability-client.ts
|
|
5
5
|
var astro_resumability_client_default = createHydrator((store, _props, { element, application }) => {
|
|
6
6
|
const scopes = application.get(createResumption, () => /* @__PURE__ */ new WeakMap());
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createRenderer } from "./astro-server.js";
|
|
2
1
|
import { resumableRenderer } from "resumability/astro-server";
|
|
2
|
+
import { createRenderer } from "./astro-server.js";
|
|
3
3
|
// src/astro-resumability-server.ts
|
|
4
4
|
var astro_resumability_server_default = resumableRenderer(createRenderer(true), { isolate: (component) => Boolean(component.createStore ?? component.isolate) });
|
|
5
5
|
export { astro_resumability_server_default as default };
|
package/dist/astro-server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as failPreparation, r as storeContext } from "./astro-context-
|
|
2
|
-
import { t as requestApplication } from "./astro-request-
|
|
3
|
-
import { n as islandStore, t as island } from "./astro-shared-
|
|
4
|
-
import { t as renderToStringWithReads } from "./server-renderer-
|
|
1
|
+
import { n as failPreparation, r as storeContext } from "./astro-context-B9XKrz8c.js";
|
|
2
|
+
import { t as requestApplication } from "./astro-request-C0eYQlmS.js";
|
|
3
|
+
import { n as islandStore, t as island } from "./astro-shared-CwBaV3Xu.js";
|
|
4
|
+
import { t as renderToStringWithReads } from "./server-renderer-CjTOgG1b.js";
|
|
5
5
|
// src/astro-server.ts
|
|
6
6
|
const createRenderer = (awaitState = false) => ({
|
|
7
7
|
name: `spa`,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as Component, t as Capability } from "./capabilities-ChgSs6bp.js";
|
|
2
1
|
import { RootStore } from "atom.io/internal";
|
|
2
|
+
import { o as Component, t as Capability } from "./capabilities-BNnXgvo5.js";
|
|
3
3
|
interface AstroApplicationContext {
|
|
4
4
|
/** Whether the application still represents its initial server snapshot. */
|
|
5
5
|
readonly canResume: boolean;
|
|
@@ -30,4 +30,4 @@ type Island<P = any> = Component<P> & {
|
|
|
30
30
|
prepareStore?: AstroStorePreparation<P>;
|
|
31
31
|
};
|
|
32
32
|
export { Island as a, AstroStorePreparation as i, AstroStoreContext as n, AstroStoreFactory as r, AstroApplicationContext as t };
|
|
33
|
-
//# sourceMappingURL=astro-shared-
|
|
33
|
+
//# sourceMappingURL=astro-shared-C-iO4PVU.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"astro-shared-
|
|
1
|
+
{"version":3,"file":"astro-shared-C-iO4PVU.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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as jsx } from "./jsx-runtime-BGDPK50B.js";
|
|
2
1
|
import { IMPLICIT, Store } from "atom.io/internal";
|
|
2
|
+
import { n as jsx } from "./jsx-runtime-B2XxfA3E.js";
|
|
3
3
|
// src/astro-shared.ts
|
|
4
4
|
async function islandStore(component, props, context, shared, prepare) {
|
|
5
5
|
const store = await (component.createStore?.(props, context) ?? shared ?? new Store({
|
|
@@ -28,4 +28,4 @@ function island(component, props, slots) {
|
|
|
28
28
|
}
|
|
29
29
|
export { islandStore as n, island as t };
|
|
30
30
|
|
|
31
|
-
//# sourceMappingURL=astro-shared-
|
|
31
|
+
//# sourceMappingURL=astro-shared-CwBaV3Xu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"astro-shared-
|
|
1
|
+
{"version":3,"file":"astro-shared-CwBaV3Xu.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, SpaElement } 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\tprepare?: AstroStorePreparation,\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 prepare?.(store, props, context)\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): SpaElement {\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,QACA,SACqB;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,OAAO,OAAO,OAAO;CACrC,QAAQ,OAAO,eAAe;CAC9B,MAAM,UAAU,eAAe,OAAO,OAAO,OAAO;CACpD,QAAQ,OAAO,eAAe;CAC9B,OAAO;AACR;AACA,SAAgB,OACf,WACA,OACA,OACa;CACb,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"}
|
package/dist/astro.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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-KxK9OUSj.js";
|
|
3
1
|
import { AstroIntegration } from "astro";
|
|
2
|
+
import { SpaPluginOptions } from "./vite.js";
|
|
3
|
+
import { a as Island, i as AstroStorePreparation, n as AstroStoreContext, r as AstroStoreFactory, t as AstroApplicationContext } from "./astro-shared-C-iO4PVU.js";
|
|
4
4
|
export default function integration(options?: SpaPluginOptions): AstroIntegration;
|
|
5
5
|
export type { AstroApplicationContext, AstroStoreContext, AstroStoreFactory, AstroStorePreparation, Island };
|
|
6
6
|
//# sourceMappingURL=astro.d.ts.map
|
package/dist/astro.js
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
export declare const DZ2_ORBITAL_FINAL_SPIN_RADIANS = 1.1;
|
|
3
|
+
export declare const DZ2_ORBITAL_Y_ROTATION_RADIANS_PER_SECOND: number;
|
|
4
|
+
/** @internal Used by contributor tools or implementation tests. */
|
|
5
|
+
export declare const DZ2_ORBITAL_LIGHTS: {
|
|
6
|
+
core: {
|
|
7
|
+
color: number;
|
|
8
|
+
intensity: number;
|
|
9
|
+
distance: number;
|
|
10
|
+
position: [number, number, number];
|
|
11
|
+
};
|
|
12
|
+
ambient: {
|
|
13
|
+
color: number;
|
|
14
|
+
intensity: number;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
type Dz2OrbitalMesh = THREE.Mesh<THREE.BufferGeometry, THREE.MeshToonMaterial>;
|
|
18
|
+
export type Dz2OrbitalModel = {
|
|
19
|
+
orbital: THREE.Group;
|
|
20
|
+
meshes: Dz2OrbitalMesh[];
|
|
21
|
+
materials: {
|
|
22
|
+
lobe: THREE.MeshToonMaterial;
|
|
23
|
+
torus: THREE.MeshToonMaterial;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export declare function createDz2OrbitalCamera(aspect?: number): THREE.PerspectiveCamera;
|
|
27
|
+
export declare function addDz2OrbitalLights(scene: THREE.Scene): void;
|
|
28
|
+
export declare function setDz2OrbitalRotation(orbital: THREE.Object3D, y?: number): void;
|
|
29
|
+
export declare function createDz2OrbitalModel(): Dz2OrbitalModel;
|
|
30
|
+
export declare function disposeDz2OrbitalModel(model: Dz2OrbitalModel): void;
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=brand-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brand-model.d.ts","names":[],"sources":["../src/brand-model.ts"],"mappings":";qBAEa;qBAGA;;qBAkBA;;IAEX;IACA;IACA;IACA;;;IAGA;IACA;;;KAeG,iBAAiB,MAAM,KAAK,MAAM,gBAAgB,MAAM;YAEjD;EACX,SAAS,MAAM;EACf,QAAQ;EACR;IACC,MAAM,MAAM;IACZ,OAAO,MAAM;;;wBA8BC,uBAAuB,kBAAa,MAAM;wBAY1C,oBAAoB,OAAO,MAAM;wBAgBjC,sBACf,SAAS,MAAM,UACf;wBASe,yBAAyB;wBA+CzB,uBAAuB,OAAO"}
|