@atom.io/spa 0.0.10 → 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 +5 -5
- package/dist/{BrandMarkScene-CBYk-RJ2.js → BrandMarkScene-BeWazldB.js} +4 -4
- package/dist/{BrandMarkScene-CBYk-RJ2.js.map → BrandMarkScene-BeWazldB.js.map} +1 -1
- 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/{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-model.js +4 -4
- package/dist/brand.d.ts +1 -1
- package/dist/brand.js +3 -3
- 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/{core-DD2giR6E.js → core-N07x1OaR.js} +1 -1
- package/dist/{core-DD2giR6E.js.map → core-N07x1OaR.js.map} +1 -1
- package/dist/development/{BrandMarkScene-BDdC7K5M.js → BrandMarkScene-B282kBA3.js} +4 -4
- package/dist/development/{BrandMarkScene-BDdC7K5M.js.map → BrandMarkScene-B282kBA3.js.map} +1 -1
- 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/development/{astro-request-DRKvDjsO.js → 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 +4 -4
- package/dist/development/brand.js +3 -3
- 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-CEVtlaav.js → dom-C1cVf5Vm.js} +4 -4
- package/dist/development/{dom-CEVtlaav.js.map → dom-C1cVf5Vm.js.map} +1 -1
- package/dist/development/floating.js +1 -1
- package/dist/development/hot.js +1 -1
- package/dist/{identity-ByJswZtF.js → development/identity-DWHH6jbd.js} +2 -2
- package/dist/development/{identity-B8wTFkyW.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 +1 -1
- package/dist/development/renderer.js +3 -3
- package/dist/development/{server-renderer-zAqEL1g1.js → server-renderer-B-L5tNg7.js} +4 -4
- package/dist/development/{server-renderer-zAqEL1g1.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-CsZ6Od1C.js → three-F5D1OnE9.js} +4 -4
- package/dist/development/{three-CsZ6Od1C.js.map → three-F5D1OnE9.js.map} +1 -1
- package/dist/development/three.js +1 -1
- package/dist/{vite-WUiz1ju6.js → development/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-DUpa3Sj2.js → dom-BbfEAPpR.js} +4 -4
- package/dist/{dom-DUpa3Sj2.js.map → dom-BbfEAPpR.js.map} +1 -1
- package/dist/floating.d.ts +1 -1
- package/dist/floating.js +1 -1
- package/dist/hot.d.ts +1 -1
- package/dist/hot.js +1 -1
- package/dist/{development/identity-B8wTFkyW.js → identity-wPtz6EJM.js} +2 -2
- package/dist/{identity-ByJswZtF.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 +1 -1
- package/dist/motion.js +1 -1
- package/dist/renderer.d.ts +1 -1
- package/dist/renderer.js +3 -3
- package/dist/{server-renderer-D7CdyOMo.js → server-renderer-CjTOgG1b.js} +4 -4
- package/dist/{server-renderer-D7CdyOMo.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 +9 -9
- 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-DcYxRXPW.js → three-DGOOlFXk.js} +4 -4
- package/dist/{three-DcYxRXPW.js.map → three-DGOOlFXk.js.map} +1 -1
- package/dist/three.d.ts +3 -3
- package/dist/three.js +1 -1
- package/dist/{development/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 +8 -8
package/README.md
CHANGED
|
@@ -724,11 +724,11 @@ Sizes are exact minified and level-9 gzip JavaScript byte counts. Declarations,
|
|
|
724
724
|
|
|
725
725
|
| Recipe | Entry | Minified JS | Gzip JS |
|
|
726
726
|
| -------------------------------- | --------------------------------- | ----------: | -------: |
|
|
727
|
-
| Family app with refs and history | `tonnage-recipes/family-app.ts` |
|
|
728
|
-
| Async interactive client app | `tonnage-recipes/async-app.ts` |
|
|
729
|
-
| Interactive client app | `tonnage-recipes/client-app.ts` |
|
|
730
|
-
| Hydrated interactive app | `tonnage-recipes/hydrated-app.ts` |
|
|
731
|
-
| 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 |
|
|
732
732
|
|
|
733
733
|
Report maintained with [tonnage](https://github.com/jeremybanka/tonnage).
|
|
734
734
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DZ2_ORBITAL_LIGHTS, DZ2_ORBITAL_Y_ROTATION_RADIANS_PER_SECOND, createDz2OrbitalCamera, createDz2OrbitalModel, disposeDz2OrbitalModel } from "./brand-model.js";
|
|
2
|
-
import { f as onMount, u as onCleanup } from "./core-DD2giR6E.js";
|
|
3
|
-
import { h as PointLight, i as Canvas, l as Mesh, o as Group, t as AmbientLight } from "./three-DcYxRXPW.js";
|
|
4
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
5
|
// src/BrandMarkScene.module.css
|
|
6
6
|
var BrandMarkScene_module_default = { "class": "atom-io-spa-BrandMarkScene-module-class" };
|
|
7
7
|
// src/BrandMarkScene.tsx
|
|
@@ -137,4 +137,4 @@ function BrandMarkScene(props) {
|
|
|
137
137
|
BrandMarkScene.spa = true;
|
|
138
138
|
export { BrandMarkScene };
|
|
139
139
|
|
|
140
|
-
//# sourceMappingURL=BrandMarkScene-
|
|
140
|
+
//# sourceMappingURL=BrandMarkScene-BeWazldB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrandMarkScene-
|
|
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,oBA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BAAmB,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
package/dist/brand-model.js
CHANGED
|
@@ -23,7 +23,7 @@ const DZ2_ORBITAL_CAMERA = {
|
|
|
23
23
|
/** @internal Used by contributor tools or implementation tests. */
|
|
24
24
|
const DZ2_ORBITAL_LIGHTS = {
|
|
25
25
|
core: {
|
|
26
|
-
color:
|
|
26
|
+
color: 0xffffff,
|
|
27
27
|
intensity: 28,
|
|
28
28
|
distance: 9,
|
|
29
29
|
position: [
|
|
@@ -33,7 +33,7 @@ const DZ2_ORBITAL_LIGHTS = {
|
|
|
33
33
|
]
|
|
34
34
|
},
|
|
35
35
|
ambient: {
|
|
36
|
-
color:
|
|
36
|
+
color: 0x9fd6ff,
|
|
37
37
|
intensity: 1.4
|
|
38
38
|
}
|
|
39
39
|
};
|
|
@@ -76,8 +76,8 @@ function createDz2OrbitalModel() {
|
|
|
76
76
|
const orbital = new THREE.Group();
|
|
77
77
|
setDz2OrbitalRotation(orbital);
|
|
78
78
|
const lobeMaterial = new THREE.MeshToonMaterial({
|
|
79
|
-
color:
|
|
80
|
-
emissive:
|
|
79
|
+
color: 0xff3366,
|
|
80
|
+
emissive: 0xff3366,
|
|
81
81
|
emissiveIntensity: .22,
|
|
82
82
|
opacity: .82,
|
|
83
83
|
side: THREE.DoubleSide
|
package/dist/brand.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Optional atom.io branding, with its Three.js scene loaded on browser mount. */
|
|
2
|
-
import { u as SpaElement } from "./capabilities-
|
|
2
|
+
import { u as SpaElement } from "./capabilities-BNnXgvo5.js";
|
|
3
3
|
interface BrandMarkProps {
|
|
4
4
|
/** Compact mark by default; splash fills the viewport behind page content. */
|
|
5
5
|
variant?: `mark` | `splash`;
|
package/dist/brand.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { f as onMount, p as owner, s as invalidate, u as onCleanup } from "./core-DD2giR6E.js";
|
|
2
|
-
import { n as jsx$1 } from "./jsx-runtime-BGDPK50B.js";
|
|
3
1
|
import { jsx } from "@atom.io/spa/jsx-runtime";
|
|
2
|
+
import { f as onMount, p as owner, s as invalidate, u as onCleanup } from "./core-N07x1OaR.js";
|
|
3
|
+
import { n as jsx$1 } from "./jsx-runtime-B2XxfA3E.js";
|
|
4
4
|
// src/BrandMark.module.css
|
|
5
5
|
var BrandMark_module_default = { "class": "atom-io-spa-BrandMark-module-class" };
|
|
6
6
|
// src/BrandMark.tsx
|
|
@@ -35,7 +35,7 @@ function BrandMark(props) {
|
|
|
35
35
|
observer.disconnect();
|
|
36
36
|
view.removeEventListener(`resize`, resize);
|
|
37
37
|
});
|
|
38
|
-
import("./BrandMarkScene-
|
|
38
|
+
import("./BrandMarkScene-BeWazldB.js").then(({ BrandMarkScene: component }) => {
|
|
39
39
|
if (active) {
|
|
40
40
|
Scene = component;
|
|
41
41
|
invalidate(scope);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { RootStore } from "atom.io/internal";
|
|
2
|
-
import { Canonical } from "atom.io/foundations/canonical";
|
|
3
1
|
import { ReadableFamilyToken, ReadableToken, RegularAtomFamilyToken, RegularAtomToken, Setter, TimelineFamilyToken, TimelineManageable, TimelineToken, TransactionToken, ViewOf, WritableFamilyToken, WritableToken, disposeState } from "atom.io";
|
|
2
|
+
import { Canonical } from "atom.io/foundations/canonical";
|
|
3
|
+
import { RootStore } from "atom.io/internal";
|
|
4
4
|
interface ExitHandle {
|
|
5
5
|
finished: Promise<void>;
|
|
6
6
|
cancel(): void;
|
|
@@ -151,4 +151,4 @@ interface Capability {
|
|
|
151
151
|
attach(target: CapabilityTarget, scope?: Scope): CapabilityBinding;
|
|
152
152
|
}
|
|
153
153
|
export { useTransaction as S, useId as _, Children as a, useStore as b, RootBoundary as c, TimelineControls as d, onCleanup as f, useGetter as g, useDisposal as h, Accessor as i, RootOptions as l, onMount as m, CapabilityBinding as n, Component as o, onCommit as p, CapabilityTarget as r, Root as s, Capability as t, SpaElement as u, useRef as v, useTimeline as x, useSetter as y };
|
|
154
|
-
//# sourceMappingURL=capabilities-
|
|
154
|
+
//# sourceMappingURL=capabilities-BNnXgvo5.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities-
|
|
1
|
+
{"version":3,"file":"capabilities-BNnXgvo5.d.ts","names":[],"sources":["../src/presence.ts","../src/core.ts","../src/capabilities.ts"],"mappings":";;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, useTransaction as E, useRef as S, useTimeline as T, scopeCapabilities as _, enqueue as a, useGetter as b, isPresent as c, onCommit as d, onMount as f, resolveStateToken as g, reportScopeError as h, dispose as i, observe as l, plain as m, createRoot as n, fail as o, owner as p, createScope as r, invalidate as s, RootBoundary as t, onCleanup as u, untrack as v, useStore as w, useId as x, useDisposal as y };
|
|
450
450
|
|
|
451
|
-
//# sourceMappingURL=core-
|
|
451
|
+
//# sourceMappingURL=core-N07x1OaR.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-DD2giR6E.js","names":[],"sources":["../src/core.ts"],"sourcesContent":["import type {\n\tdisposeState,\n\tReadableFamilyToken,\n\tReadableToken,\n\tRegularAtomFamilyToken,\n\tRegularAtomToken,\n\tSetter,\n\tTimelineFamilyToken,\n\tTimelineManageable,\n\tTimelineToken,\n\tTransactionToken,\n\tViewOf,\n\tWritableFamilyToken,\n\tWritableToken,\n} from \"atom.io\"\nimport type { Canonical } from \"atom.io/foundations/canonical\"\nimport type { RootStore } from \"atom.io/internal\"\nimport {\n\tactUponStore,\n\tclearTimelineInStore,\n\tdisposeFromStore,\n\tfindInStore,\n\tfindTimelineInStore,\n\tgetFromStore,\n\tgetTimelineTransactionAtHead,\n\tIMPLICIT,\n\tsetIntoStore,\n\tsubscribeToState,\n\tsubscribeToTimeline,\n\ttimeTravel,\n\ttimeTravelTransactionGroupInStore,\n\twithdraw,\n} from \"atom.io/internal\"\n\nimport type { Capability } from \"./capabilities.ts\"\nimport type {\n\tExitParticipant,\n\tPresenceCoordinator,\n\tPresenceTarget,\n} from \"./presence.ts\"\n\nexport type Cleanup = () => void\n// A callable interface permits the recursive Children union. A type alias does not.\n/* oxlint-disable typescript/prefer-function-type -- A callable interface is required for recursive Children. */\nexport interface Accessor<T> {\n\t(): T\n}\n/* oxlint-enable typescript/prefer-function-type */\nexport type Component<P = any> = (props: P) => Children\n/** A JSX descriptor for an intrinsic tag, component, or fragment. */\nexport interface SpaElement {\n\ttype: string | Component | null\n\tprops: Record<string, any>\n}\n/** Renderable content, including nested groups and reactive accessors. */\nexport type Children =\n\t| SpaElement\n\t| string\n\t| number\n\t| bigint\n\t| boolean\n\t| null\n\t| undefined\n\t| readonly Children[]\n\t| Accessor<Children>\nexport interface RootOptions {\n\tcapabilities?: readonly Capability[]\n\tstore?: RootStore\n\tidPrefix?: string\n\tonError?: (error: unknown) => void\n}\ninterface BoundaryOptions extends Omit<RootOptions, `capabilities`> {\n\t_capabilities?: Map<string, Capability>\n}\nexport interface Scope {\n\t_exiting?: boolean\n\t_exits?: Set<ExitParticipant>\n\t_targets?: Set<PresenceTarget>\n\t_root: Root\n\t_parent?: Scope | undefined\n\t_options?: BoundaryOptions | undefined\n\t_setupOrder: number\n\t_cleanups: Set<Cleanup | Scope>\n\t_updates: Cleanup[]\n\t_dead: boolean\n}\nexport interface Root extends Scope {\n\t_onRead?:\n\t\t| ((value: unknown, token: ReadableToken<unknown>, store: RootStore) => void)\n\t\t| undefined\n\t_presence?: PresenceCoordinator\n\t_presenceFactory?: Capability[`presence`]\n\t_capabilities: Map<string, Capability>\n\t_boundaryCapabilities?: Map<Capability, number>\n\t_prepareCapability?: ((capability: Capability) => void) | undefined\n\t_failure?: { error: unknown; report: Root[`error`] } | undefined\n\t_store: RootStore\n\t_prefix: string\n\t_id: number\n\t_queue: Set<Cleanup>\n\t_enqueueCount?: number\n\t_mounts: Cleanup[] | undefined\n\t_commits?: Set<CommitJob>\n\t_flushing?: boolean\n\t_forms?: Set<() => boolean>\n\t_host?: Element\n\tflush: Cleanup\n\terror: (error: unknown) => void\n}\n\ninterface CommitJob {\n\tscope: Scope\n\torder: number\n\trun: Cleanup\n\tloopError: Error | undefined\n}\ninterface CommitGroup {\n\torder: number\n\tchildren: CommitGroup[]\n\tjobs: CommitJob[]\n}\n\nexport let owner: Scope | undefined\ntype Subscribe = (notify: Cleanup) => Cleanup\nlet tracking: ((subscribe: Subscribe) => void) | undefined\nlet serial = 0\nlet setupOrder = 0\n\nfunction scopedErrorHandler(\n\tscope: Scope,\n\terror: unknown,\n): Root[`error`] | undefined {\n\tconst failure = scope._root._failure\n\treturn failure && Object.is(failure.error, error)\n\t\t? failure.report\n\t\t: scope._options?.onError\n}\nfunction throwScopedError(\n\tscope: Scope,\n\terror: unknown,\n\treport = scopedErrorHandler(scope, error),\n): never {\n\tif (report) scope._root._failure = { error, report }\n\tthrow error\n}\nexport function within<T>(scope: Scope, run: () => T): T {\n\tconst previous = owner\n\towner = scope\n\ttry {\n\t\treturn run()\n\t} catch (error) {\n\t\tthrowScopedError(scope, error)\n\t} finally {\n\t\towner = previous\n\t}\n}\nexport function untrack<T>(run: () => T): T {\n\tconst previous = tracking\n\ttracking = undefined\n\ttry {\n\t\treturn run()\n\t} finally {\n\t\ttracking = previous\n\t}\n}\nexport function createScope(parent?: Scope): Scope {\n\tconst child: Scope = {\n\t\t_root: parent?._root as Root,\n\t\t_parent: parent,\n\t\t_options: parent?._options,\n\t\t_setupOrder: setupOrder++,\n\t\t_cleanups: new Set(),\n\t\t_updates: [],\n\t\t_dead: false,\n\t}\n\tparent?._cleanups.add(child)\n\treturn child\n}\nexport function fail(scope: Scope, error: unknown): never {\n\tconst report = scopedErrorHandler(scope, error)\n\ttry {\n\t\tdispose(scope)\n\t} catch (cleanup) {\n\t\tthrowScopedError(scope, new AggregateError([error, cleanup]), report)\n\t}\n\tthrow error\n}\nexport function dispose(scope: Scope): void {\n\tif (scope._dead) return\n\tscope._dead = true\n\tconst errors: unknown[] = []\n\tlet report: Root[`error`] | undefined\n\tconst record = (error: unknown) => {\n\t\terrors.push(error)\n\t\t// Keep the first boundary handler as nested disposal wraps its errors.\n\t\treport ??= scopedErrorHandler(scope, error)\n\t}\n\ttry {\n\t\tscope._root._presence?.forget(scope)\n\t} catch (error) {\n\t\trecord(error)\n\t}\n\tfor (const cleanup of [...scope._cleanups].reverse()) {\n\t\ttry {\n\t\t\ttypeof cleanup === `function` ? cleanup() : dispose(cleanup)\n\t\t} catch (error) {\n\t\t\trecord(error)\n\t\t}\n\t}\n\tscope._parent?._cleanups.delete(scope)\n\tscope._cleanups.clear()\n\tscope._targets?.clear()\n\tscope._updates.length = 0\n\tif (errors.length) throwScopedError(scope, new AggregateError(errors), report)\n}\nexport function invalidate(scope: Scope): void {\n\tfor (const run of scope._updates) enqueue(scope, run)\n\tfor (const child of scope._cleanups)\n\t\tif (typeof child !== `function`) invalidate(child)\n}\nexport function enqueue(scope: Scope, run: Cleanup): void {\n\tif (!isPresent(scope)) return\n\tconst root = scope._root\n\tif (!root._queue.size && !root._flushing)\n\t\tqueueMicrotask(() => {\n\t\t\ttry {\n\t\t\t\troot.flush()\n\t\t\t} catch (error) {\n\t\t\t\tconst report = scopedErrorHandler(root, error) ?? root.error\n\t\t\t\troot._failure = undefined\n\t\t\t\treport(error)\n\t\t\t}\n\t\t})\n\t// A write can invalidate an observer that is already pending.\n\tif (import.meta.env.DEV) root._enqueueCount = (root._enqueueCount ?? 0) + 1\n\troot._queue.add(run)\n}\n\nfunction runCommits(root: Root, pending: Set<CommitJob>): CommitJob | undefined {\n\tconst top: CommitGroup = { order: root._setupOrder, children: [], jobs: [] }\n\tconst groups = new Map<Scope, CommitGroup>([[root, top]])\n\t// Keep only branches with pending work. Visit siblings in setup order.\n\tconst groupFor = (scope: Scope): CommitGroup => {\n\t\tlet group = groups.get(scope)\n\t\tif (!group) {\n\t\t\tgroup = { order: scope._setupOrder, children: [], jobs: [] }\n\t\t\tgroups.set(scope, group)\n\t\t\tgroupFor(scope._parent!).children.push(group)\n\t\t}\n\t\treturn group\n\t}\n\tfor (const job of [...pending].sort((a, b) => a.order - b.order))\n\t\tgroupFor(job.scope).jobs.push(job)\n\tlet last: CommitJob | undefined\n\tconst visit = (group: CommitGroup) => {\n\t\tfor (const child of group.children.sort((a, b) => a.order - b.order))\n\t\t\tvisit(child)\n\t\tfor (const job of group.jobs) {\n\t\t\tif (pending.delete(job) && isPresent(job.scope)) {\n\t\t\t\tconst enqueueCount = import.meta.env.DEV ? root._enqueueCount : undefined\n\t\t\t\tjob.run()\n\t\t\t\tif (import.meta.env.DEV && root._enqueueCount !== enqueueCount)\n\t\t\t\t\tlast = job\n\t\t\t}\n\t\t}\n\t}\n\tvisit(top)\n\treturn last\n}\n\nfunction capabilityMap(list: readonly Capability[] | undefined) {\n\tconst capabilities = new Map<string, Capability>()\n\tfor (const capability of list ?? []) {\n\t\tif (capabilities.has(capability.namespace))\n\t\t\tthrow new Error(`spa: duplicate capability ${capability.namespace}`)\n\t\tcapabilities.set(capability.namespace, capability)\n\t}\n\treturn capabilities\n}\nfunction registerPresence(\n\troot: Root,\n\tcapability: Capability,\n\tshared = false,\n): void {\n\tconst create = capability.presence\n\tif (!create) return\n\tif (root._presence) {\n\t\tif (!shared || root._presenceFactory !== create)\n\t\t\tthrow new Error(`spa: multiple presence coordinators`)\n\t} else {\n\t\troot._presence = create(root)\n\t\troot._presenceFactory = create\n\t}\n}\nexport function scopeCapabilities(scope: Scope): Map<string, Capability> {\n\treturn scope._options?._capabilities ?? scope._root._capabilities\n}\nexport function reportScopeError(scope: Scope, error: unknown): void {\n\tconst report = scopedErrorHandler(scope, error) ?? scope._root.error\n\ttry {\n\t\tfail(scope._root, error)\n\t} catch (failure) {\n\t\tscope._root._failure = undefined\n\t\treport(failure)\n\t}\n}\n\n/** Override root options for these children while sharing their parent's ownership. */\nexport function RootBoundary(\n\tprops: RootOptions & { children?: Children },\n): Children {\n\tconst scope = owner!\n\tconst { store, idPrefix, onError, capabilities } = props\n\tconst options = { ...scope._options }\n\tif (store !== undefined) options.store = store\n\tif (idPrefix !== undefined) options.idPrefix = idPrefix\n\tif (onError !== undefined) options.onError = onError\n\tif (capabilities !== undefined) {\n\t\toptions._capabilities = capabilityMap(capabilities)\n\t\tconst root = scope._root\n\t\tconst active = (root._boundaryCapabilities ??= new Map())\n\t\tfor (const capability of options._capabilities.values()) {\n\t\t\tregisterPresence(root, capability, true)\n\t\t\tactive.set(capability, (active.get(capability) ?? 0) + 1)\n\t\t\tscope._cleanups.add(() => {\n\t\t\t\tconst remaining = active.get(capability)! - 1\n\t\t\t\tif (remaining) active.set(capability, remaining)\n\t\t\t\telse active.delete(capability)\n\t\t\t})\n\t\t\troot._prepareCapability?.(capability)\n\t\t}\n\t}\n\tscope._options = options\n\treturn () => props.children\n}\n\nexport function createRoot(options: RootOptions = {}, server = false): Root {\n\tconst capabilities = capabilityMap(options.capabilities)\n\tconst root = {\n\t\t_capabilities: capabilities,\n\t\t_store: options.store ?? IMPLICIT.STORE,\n\t\t_prefix: options.idPrefix ?? `w${serial++}`,\n\t\t_id: 0,\n\t\t...createScope(),\n\t\t_queue: new Set(),\n\t\t_mounts: server ? undefined : [],\n\t} as unknown as Root\n\troot._root = root\n\troot.error =\n\t\toptions.onError ??\n\t\t((error) => {\n\t\t\tthrow error\n\t\t})\n\tfor (const capability of capabilities.values())\n\t\tregisterPresence(root, capability)\n\tconst hasWrites = () => root._queue.size || root._mounts!.length\n\tconst hasWork = () => hasWrites() || root._commits?.size\n\tlet flushPendingWrites: Cleanup | undefined\n\troot.flush = () => {\n\t\tconst nested = root._flushing\n\t\tif (!(nested ? hasWrites() : hasWork()) && !root._forms?.size) return\n\t\troot._flushing = true\n\t\ttry {\n\t\t\tif (nested) {\n\t\t\t\t// The outer flush owns commit dispatch. Mount callbacks can drain writes.\n\t\t\t\tflushPendingWrites?.()\n\t\t\t\treturn\n\t\t\t}\n\t\t\troot._failure = undefined\n\t\t\tlet passes = 0\n\t\t\tlet lastCommit: CommitJob | undefined\n\t\t\tconst checkLoop = () => {\n\t\t\t\tif (import.meta.env.DEV && ++passes > 100)\n\t\t\t\t\tthrow lastCommit?.loopError ?? new Error(`spa: update loop`)\n\t\t\t}\n\t\t\tconst runWriteBatch = () => {\n\t\t\t\tconst commits = new Map<Capability, Cleanup | undefined>()\n\t\t\t\tconst prepare = (capability: Capability) => {\n\t\t\t\t\tif (!commits.has(capability))\n\t\t\t\t\t\tcommits.set(capability, capability.beforeUpdate?.(root))\n\t\t\t\t}\n\t\t\t\tconst previous = root._prepareCapability\n\t\t\t\troot._prepareCapability = prepare\n\t\t\t\tlet formsReady = true\n\t\t\t\ttry {\n\t\t\t\t\tfor (const capability of capabilities.values()) prepare(capability)\n\t\t\t\t\tfor (const capability of root._boundaryCapabilities?.keys() ?? [])\n\t\t\t\t\t\tprepare(capability)\n\t\t\t\t\twhile (hasWrites()) {\n\t\t\t\t\t\tcheckLoop()\n\t\t\t\t\t\tfor (const run of [...root._queue])\n\t\t\t\t\t\t\tif (root._queue.delete(run)) run()\n\t\t\t\t\t\tfor (const run of root._mounts!.splice(0)) run()\n\t\t\t\t\t}\n\t\t\t\t\tfor (const restore of root._forms ?? [])\n\t\t\t\t\t\tif (!untrack(restore)) formsReady = false\n\t\t\t\t} finally {\n\t\t\t\t\troot._prepareCapability = previous\n\t\t\t\t\tfor (const commit of commits.values()) commit?.()\n\t\t\t\t}\n\t\t\t\treturn formsReady\n\t\t\t}\n\t\t\tdo {\n\t\t\t\tflushPendingWrites = runWriteBatch\n\t\t\t\tconst formsReady = runWriteBatch()\n\t\t\t\tflushPendingWrites = undefined\n\t\t\t\tif (!hasWrites()) {\n\t\t\t\t\t// Form event completion schedules a flush to restore the controls.\n\t\t\t\t\tif (!formsReady || !root._commits?.size) break\n\t\t\t\t\tcheckLoop()\n\t\t\t\t\tlastCommit = runCommits(root, root._commits) ?? lastCommit\n\t\t\t\t}\n\t\t\t} while (hasWork())\n\t\t\troot._failure = undefined\n\t\t} catch (error) {\n\t\t\tflushPendingWrites = undefined\n\t\t\tfail(root, error)\n\t\t} finally {\n\t\t\tif (!nested) root._flushing = false\n\t\t}\n\t}\n\treturn root\n}\n/** Return the atom.io store selected by the current owner. */\nexport function useStore(): RootStore {\n\treturn owner!._options?.store ?? owner!._root._store\n}\n/** Return atom.io disposal bound to the current root's store. */\nexport function useDisposal(): typeof disposeState {\n\treturn disposeFromStore.bind(null, useStore()) as typeof disposeState\n}\nexport function onCleanup(cleanup: Cleanup): void {\n\towner!._cleanups.add(cleanup)\n}\nexport function onMount(run: Cleanup): void {\n\tconst scope = owner!\n\tscope._root._mounts?.push(() => {\n\t\tif (!scope._dead)\n\t\t\twithin(scope, () => {\n\t\t\t\tuntrack(run)\n\t\t\t})\n\t})\n}\n/** Observe state during setup and apply changes after the root's writes. */\nexport function onCommit<T>(\n\tread: Accessor<T>,\n\tapply: (value: T, previous: T | undefined) => void | Cleanup,\n): void {\n\tconst scope = owner!\n\tconst root = scope._root\n\tif (!root._mounts) return\n\tconst pending = (root._commits ??= new Set())\n\tlet ran = false\n\tlet next: T\n\tlet previous: T | undefined\n\tlet cleanup: Cleanup | void\n\tconst clear = () => {\n\t\tconst release = cleanup\n\t\tcleanup = undefined\n\t\tif (release) untrack(release)\n\t}\n\tconst job: CommitJob = {\n\t\tscope,\n\t\torder: setupOrder++,\n\t\t// The registration stack identifies the component in a feedback loop.\n\t\tloopError: import.meta.env.DEV\n\t\t\t? new Error(`spa: onCommit update loop`)\n\t\t\t: undefined,\n\t\trun() {\n\t\t\twithin(scope, () => {\n\t\t\t\tuntrack(() => {\n\t\t\t\t\tclear()\n\t\t\t\t\tif (!isPresent(scope)) return\n\t\t\t\t\tconst old = previous\n\t\t\t\t\tprevious = next\n\t\t\t\t\tran = true\n\t\t\t\t\tcleanup = apply(next, old)\n\t\t\t\t\tif (scope._dead) clear()\n\t\t\t\t})\n\t\t\t})\n\t\t},\n\t}\n\tscope._cleanups.add(() => {\n\t\tpending.delete(job)\n\t\tclear()\n\t})\n\tobserve(scope, read, (value) => {\n\t\tnext = value\n\t\tif (!ran || !Object.is(value, previous)) pending.add(job)\n\t\telse pending.delete(job)\n\t})\n}\nexport function useId(): string {\n\tconst root = owner!._root\n\treturn `${owner!._options?.idPrefix ?? root._prefix}-${root._id++}`\n}\n\nexport function observe<T>(\n\tscope: Scope,\n\tread: Accessor<T>,\n\tapply: (value: T) => void,\n): void {\n\tconst subscriptions = new Map<Subscribe, Cleanup>()\n\tconst run = () => {\n\t\tif (!isPresent(scope)) return\n\t\tconst used = new Set<Subscribe>()\n\t\tconst previous = tracking\n\t\ttracking = (subscribe) => {\n\t\t\tused.add(subscribe)\n\t\t\tif (!subscriptions.has(subscribe))\n\t\t\t\tsubscriptions.set(\n\t\t\t\t\tsubscribe,\n\t\t\t\t\tsubscribe(() => {\n\t\t\t\t\t\tenqueue(scope, run)\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t}\n\t\tlet value: T\n\t\ttry {\n\t\t\tvalue = within(scope, read)\n\t\t} finally {\n\t\t\ttracking = previous\n\t\t\tfor (const [subscribe, unsubscribe] of subscriptions)\n\t\t\t\tif (!used.has(subscribe)) {\n\t\t\t\t\tunsubscribe()\n\t\t\t\t\tsubscriptions.delete(subscribe)\n\t\t\t\t}\n\t\t}\n\t\twithin(scope, () => {\n\t\t\tuntrack(() => {\n\t\t\t\tapply(value)\n\t\t\t})\n\t\t})\n\t}\n\tscope._updates.push(run)\n\tscope._cleanups.add(() => {\n\t\tscope._root._queue.delete(run)\n\t\tfor (const unsubscribe of subscriptions.values()) unsubscribe()\n\t})\n\trun()\n}\n\n/** Resolve a fixed family key in the current owner's store. */\nexport function resolveStateToken(token: any, key?: Canonical): any {\n\tconst store = useStore()\n\treturn token.type.endsWith(`_family`) ? findInStore(store, token, key!) : token\n}\n\n/** Capture a token for this instance. Change the component key to change its token. */\nexport function useGetter<T, E = never>(\n\ttoken: ReadableToken<T, any, E>,\n): Accessor<ViewOf<T | E>>\nexport function useGetter<T, K extends Canonical, E = never>(\n\tfamily: ReadableFamilyToken<T, K, E>,\n\tkey: NoInfer<K>,\n): Accessor<ViewOf<T | E>>\nexport function useGetter(token: any, key?: Canonical): Accessor<any> {\n\ttoken = resolveStateToken(token, key)\n\tconst root = owner!._root\n\tconst store = useStore()\n\tconst subscribe: Subscribe = (notify) =>\n\t\tsubscribeToState(store, token, `spa:${serial++}`, notify)\n\treturn () => {\n\t\tconst value = getFromStore(store, token)\n\t\troot._onRead?.(value, token, store)\n\t\ttracking?.(subscribe)\n\t\treturn value\n\t}\n}\nexport function useSetter<T>(\n\ttoken: WritableToken<T, any, any>,\n): (value: T | Setter<T>) => void\nexport function useSetter<T, K extends Canonical>(\n\tfamily: WritableFamilyToken<T, K, any>,\n\tkey: NoInfer<K>,\n): (value: T | Setter<T>) => void\nexport function useSetter(token: any, key?: Canonical): (value: any) => void {\n\ttoken = resolveStateToken(token, key)\n\tconst store = useStore()\n\treturn (value) => {\n\t\tsetIntoStore(store, token, value)\n\t}\n}\nexport function useTransaction<F extends (...args: any[]) => any>(\n\ttoken: TransactionToken<F>,\n): (...args: Parameters<F>) => ReturnType<F> {\n\treturn actUponStore(useStore(), token, `spa:${serial++}`)\n}\n\nconst refs = new WeakMap<RootStore, Map<string, object>>()\nexport function useRef<E extends Element>(\n\ttoken: RegularAtomToken<E | null>,\n): (element: E | null) => void\nexport function useRef<E extends Element, K extends Canonical>(\n\tfamily: RegularAtomFamilyToken<E | null, K>,\n\tkey: NoInfer<K>,\n): (element: E | null) => void\nexport function useRef<E extends Element>(\n\ttoken: any,\n\tkey?: Canonical,\n): (element: E | null) => void {\n\ttoken = resolveStateToken(token, key)\n\tconst store = useStore()\n\tconst owners = refs.get(store) ?? new Map<string, object>()\n\trefs.set(store, owners)\n\tconst identity = {}\n\tlet held: E | null = null\n\treturn (element) => {\n\t\tif (element) {\n\t\t\theld = element\n\t\t\towners.set(token.key, identity)\n\t\t\tsetIntoStore(store, token, element)\n\t\t} else if (owners.get(token.key) === identity) {\n\t\t\towners.delete(token.key)\n\t\t\tif (getFromStore(store, token) === held) setIntoStore(store, token, null)\n\t\t\theld = null\n\t\t}\n\t}\n}\nexport interface TimelineControls {\n\tgetCursor(): number\n\tgetLength(): number\n\tundo(): void\n\tredo(): void\n\tclear(): void\n\tgetTransaction(): { undo?: Cleanup; redo?: Cleanup }\n}\nexport function useTimeline<M extends TimelineManageable>(\n\ttoken: TimelineToken<M>,\n): TimelineControls\nexport function useTimeline<K extends Canonical, M extends TimelineManageable>(\n\tfamily: TimelineFamilyToken<K, M>,\n\tkey: NoInfer<K>,\n): TimelineControls\nexport function useTimeline(token: any, key?: Canonical): TimelineControls {\n\tconst store = useStore()\n\tconst selected: TimelineToken<any> =\n\t\ttoken.type === `timeline_family`\n\t\t\t? findTimelineInStore(store, token, key!)\n\t\t\t: token\n\tconst subscribe: Subscribe = (notify) =>\n\t\tsubscribeToTimeline(store, selected, `spa:${serial++}`, notify)\n\tconst read = () => {\n\t\tconst timeline = withdraw(store, selected)\n\t\ttracking?.(subscribe)\n\t\treturn timeline\n\t}\n\treturn {\n\t\tgetCursor: () => read().at,\n\t\tgetLength: () => read().history.length,\n\t\tundo: () => {\n\t\t\ttimeTravel(store, `undo`, selected)\n\t\t},\n\t\tredo: () => {\n\t\t\ttimeTravel(store, `redo`, selected)\n\t\t},\n\t\tclear: () => {\n\t\t\tclearTimelineInStore(store, selected)\n\t\t},\n\t\tgetTransaction: () => {\n\t\t\tconst timeline = read()\n\t\t\tconst controls: ReturnType<TimelineControls[`getTransaction`]> = {}\n\t\t\tfor (const direction of [`undo`, `redo`] as const) {\n\t\t\t\tconst group = getTimelineTransactionAtHead(timeline, direction)\n\t\t\t\tif (group)\n\t\t\t\t\tcontrols[direction] = () => {\n\t\t\t\t\t\ttimeTravelTransactionGroupInStore(store, direction, group)\n\t\t\t\t\t}\n\t\t\t}\n\t\t\treturn controls\n\t\t},\n\t}\n}\n\nexport function plain(value: Children): string {\n\tif (typeof value === `function`) return plain(value())\n\tif (Array.isArray(value)) return value.map(plain).join(``)\n\tif (value == null || typeof value === `boolean`) return ``\n\tif (import.meta.env.DEV && typeof value === `object`)\n\t\tthrow new Error(`spa: text required`)\n\t// oxlint-disable-next-line typescript/no-base-to-string -- Valid text children are primitives here; development rejects malformed object children.\n\treturn String(value)\n}\n\nexport function isPresent(scope: Scope): boolean {\n\tfor (let at: Scope | undefined = scope; at; at = at._parent)\n\t\tif (at._dead || at._exiting) return false\n\treturn true\n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BACZ,oBAAoB,OAAO,OAAO,GAAI,IACtC;CACJ,MAAM,aAAwB,WAC7B,oBAAoB,OAAO,UAAU,OAAO,YAAY,MAAM;CAC/D,MAAM,aAAa;EAClB,MAAM,WAAW,SAAS,OAAO,QAAQ;EACzC,WAAW,SAAS;EACpB,OAAO;CACR;CACA,OAAO;EACN,iBAAiB,KAAK,CAAC,CAAC;EACxB,iBAAiB,KAAK,CAAC,CAAC,QAAQ;EAChC,YAAY;GACX,WAAW,OAAO,QAAQ,QAAQ;EACnC;EACA,YAAY;GACX,WAAW,OAAO,QAAQ,QAAQ;EACnC;EACA,aAAa;GACZ,qBAAqB,OAAO,QAAQ;EACrC;EACA,sBAAsB;GACrB,MAAM,WAAW,KAAK;GACtB,MAAM,WAA2D,CAAC;GAClE,KAAK,MAAM,aAAa,CAAC,QAAQ,MAAM,GAAY;IAClD,MAAM,QAAQ,6BAA6B,UAAU,SAAS;IAC9D,IAAI,OACH,SAAS,mBAAmB;KAC3B,kCAAkC,OAAO,WAAW,KAAK;IAC1D;GACF;GACA,OAAO;EACR;CACD;AACD;AAEA,SAAgB,MAAM,OAAyB;CAC9C,IAAI,OAAO,UAAU,YAAY,OAAO,MAAM,MAAM,CAAC;CACrD,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,MAAM,IAAI,KAAK,CAAC,CAAC,KAAK,EAAE;CACzD,IAAI,SAAS,QAAQ,OAAO,UAAU,WAAW,OAAO;CAIxD,OAAO,OAAO,KAAK;AACpB;AAEA,SAAgB,UAAU,OAAuB;CAChD,KAAK,IAAI,KAAwB,OAAO,IAAI,KAAK,GAAG,SACnD,IAAI,GAAG,SAAS,GAAG,UAAU,OAAO;CACrC,OAAO;AACR"}
|
|
1
|
+
{"version":3,"file":"core-N07x1OaR.js","names":[],"sources":["../src/core.ts"],"sourcesContent":["import type {\n\tdisposeState,\n\tReadableFamilyToken,\n\tReadableToken,\n\tRegularAtomFamilyToken,\n\tRegularAtomToken,\n\tSetter,\n\tTimelineFamilyToken,\n\tTimelineManageable,\n\tTimelineToken,\n\tTransactionToken,\n\tViewOf,\n\tWritableFamilyToken,\n\tWritableToken,\n} from \"atom.io\"\nimport type { Canonical } from \"atom.io/foundations/canonical\"\nimport type { RootStore } from \"atom.io/internal\"\nimport {\n\tactUponStore,\n\tclearTimelineInStore,\n\tdisposeFromStore,\n\tfindInStore,\n\tfindTimelineInStore,\n\tgetFromStore,\n\tgetTimelineTransactionAtHead,\n\tIMPLICIT,\n\tsetIntoStore,\n\tsubscribeToState,\n\tsubscribeToTimeline,\n\ttimeTravel,\n\ttimeTravelTransactionGroupInStore,\n\twithdraw,\n} from \"atom.io/internal\"\n\nimport type { Capability } from \"./capabilities.ts\"\nimport type {\n\tExitParticipant,\n\tPresenceCoordinator,\n\tPresenceTarget,\n} from \"./presence.ts\"\n\nexport type Cleanup = () => void\n// A callable interface permits the recursive Children union. A type alias does not.\n/* oxlint-disable typescript/prefer-function-type -- A callable interface is required for recursive Children. */\nexport interface Accessor<T> {\n\t(): T\n}\n/* oxlint-enable typescript/prefer-function-type */\nexport type Component<P = any> = (props: P) => Children\n/** A JSX descriptor for an intrinsic tag, component, or fragment. */\nexport interface SpaElement {\n\ttype: string | Component | null\n\tprops: Record<string, any>\n}\n/** Renderable content, including nested groups and reactive accessors. */\nexport type Children =\n\t| SpaElement\n\t| string\n\t| number\n\t| bigint\n\t| boolean\n\t| null\n\t| undefined\n\t| readonly Children[]\n\t| Accessor<Children>\nexport interface RootOptions {\n\tcapabilities?: readonly Capability[]\n\tstore?: RootStore\n\tidPrefix?: string\n\tonError?: (error: unknown) => void\n}\ninterface BoundaryOptions extends Omit<RootOptions, `capabilities`> {\n\t_capabilities?: Map<string, Capability>\n}\nexport interface Scope {\n\t_exiting?: boolean\n\t_exits?: Set<ExitParticipant>\n\t_targets?: Set<PresenceTarget>\n\t_root: Root\n\t_parent?: Scope | undefined\n\t_options?: BoundaryOptions | undefined\n\t_setupOrder: number\n\t_cleanups: Set<Cleanup | Scope>\n\t_updates: Cleanup[]\n\t_dead: boolean\n}\nexport interface Root extends Scope {\n\t_onRead?:\n\t\t| ((value: unknown, token: ReadableToken<unknown>, store: RootStore) => void)\n\t\t| undefined\n\t_presence?: PresenceCoordinator\n\t_presenceFactory?: Capability[`presence`]\n\t_capabilities: Map<string, Capability>\n\t_boundaryCapabilities?: Map<Capability, number>\n\t_prepareCapability?: ((capability: Capability) => void) | undefined\n\t_failure?: { error: unknown; report: Root[`error`] } | undefined\n\t_store: RootStore\n\t_prefix: string\n\t_id: number\n\t_queue: Set<Cleanup>\n\t_enqueueCount?: number\n\t_mounts: Cleanup[] | undefined\n\t_commits?: Set<CommitJob>\n\t_flushing?: boolean\n\t_forms?: Set<() => boolean>\n\t_host?: Element\n\tflush: Cleanup\n\terror: (error: unknown) => void\n}\n\ninterface CommitJob {\n\tscope: Scope\n\torder: number\n\trun: Cleanup\n\tloopError: Error | undefined\n}\ninterface CommitGroup {\n\torder: number\n\tchildren: CommitGroup[]\n\tjobs: CommitJob[]\n}\n\nexport let owner: Scope | undefined\ntype Subscribe = (notify: Cleanup) => Cleanup\nlet tracking: ((subscribe: Subscribe) => void) | undefined\nlet serial = 0\nlet setupOrder = 0\n\nfunction scopedErrorHandler(\n\tscope: Scope,\n\terror: unknown,\n): Root[`error`] | undefined {\n\tconst failure = scope._root._failure\n\treturn failure && Object.is(failure.error, error)\n\t\t? failure.report\n\t\t: scope._options?.onError\n}\nfunction throwScopedError(\n\tscope: Scope,\n\terror: unknown,\n\treport = scopedErrorHandler(scope, error),\n): never {\n\tif (report) scope._root._failure = { error, report }\n\tthrow error\n}\nexport function within<T>(scope: Scope, run: () => T): T {\n\tconst previous = owner\n\towner = scope\n\ttry {\n\t\treturn run()\n\t} catch (error) {\n\t\tthrowScopedError(scope, error)\n\t} finally {\n\t\towner = previous\n\t}\n}\nexport function untrack<T>(run: () => T): T {\n\tconst previous = tracking\n\ttracking = undefined\n\ttry {\n\t\treturn run()\n\t} finally {\n\t\ttracking = previous\n\t}\n}\nexport function createScope(parent?: Scope): Scope {\n\tconst child: Scope = {\n\t\t_root: parent?._root as Root,\n\t\t_parent: parent,\n\t\t_options: parent?._options,\n\t\t_setupOrder: setupOrder++,\n\t\t_cleanups: new Set(),\n\t\t_updates: [],\n\t\t_dead: false,\n\t}\n\tparent?._cleanups.add(child)\n\treturn child\n}\nexport function fail(scope: Scope, error: unknown): never {\n\tconst report = scopedErrorHandler(scope, error)\n\ttry {\n\t\tdispose(scope)\n\t} catch (cleanup) {\n\t\tthrowScopedError(scope, new AggregateError([error, cleanup]), report)\n\t}\n\tthrow error\n}\nexport function dispose(scope: Scope): void {\n\tif (scope._dead) return\n\tscope._dead = true\n\tconst errors: unknown[] = []\n\tlet report: Root[`error`] | undefined\n\tconst record = (error: unknown) => {\n\t\terrors.push(error)\n\t\t// Keep the first boundary handler as nested disposal wraps its errors.\n\t\treport ??= scopedErrorHandler(scope, error)\n\t}\n\ttry {\n\t\tscope._root._presence?.forget(scope)\n\t} catch (error) {\n\t\trecord(error)\n\t}\n\tfor (const cleanup of [...scope._cleanups].reverse()) {\n\t\ttry {\n\t\t\ttypeof cleanup === `function` ? cleanup() : dispose(cleanup)\n\t\t} catch (error) {\n\t\t\trecord(error)\n\t\t}\n\t}\n\tscope._parent?._cleanups.delete(scope)\n\tscope._cleanups.clear()\n\tscope._targets?.clear()\n\tscope._updates.length = 0\n\tif (errors.length) throwScopedError(scope, new AggregateError(errors), report)\n}\nexport function invalidate(scope: Scope): void {\n\tfor (const run of scope._updates) enqueue(scope, run)\n\tfor (const child of scope._cleanups)\n\t\tif (typeof child !== `function`) invalidate(child)\n}\nexport function enqueue(scope: Scope, run: Cleanup): void {\n\tif (!isPresent(scope)) return\n\tconst root = scope._root\n\tif (!root._queue.size && !root._flushing)\n\t\tqueueMicrotask(() => {\n\t\t\ttry {\n\t\t\t\troot.flush()\n\t\t\t} catch (error) {\n\t\t\t\tconst report = scopedErrorHandler(root, error) ?? root.error\n\t\t\t\troot._failure = undefined\n\t\t\t\treport(error)\n\t\t\t}\n\t\t})\n\t// A write can invalidate an observer that is already pending.\n\tif (import.meta.env.DEV) root._enqueueCount = (root._enqueueCount ?? 0) + 1\n\troot._queue.add(run)\n}\n\nfunction runCommits(root: Root, pending: Set<CommitJob>): CommitJob | undefined {\n\tconst top: CommitGroup = { order: root._setupOrder, children: [], jobs: [] }\n\tconst groups = new Map<Scope, CommitGroup>([[root, top]])\n\t// Keep only branches with pending work. Visit siblings in setup order.\n\tconst groupFor = (scope: Scope): CommitGroup => {\n\t\tlet group = groups.get(scope)\n\t\tif (!group) {\n\t\t\tgroup = { order: scope._setupOrder, children: [], jobs: [] }\n\t\t\tgroups.set(scope, group)\n\t\t\tgroupFor(scope._parent!).children.push(group)\n\t\t}\n\t\treturn group\n\t}\n\tfor (const job of [...pending].sort((a, b) => a.order - b.order))\n\t\tgroupFor(job.scope).jobs.push(job)\n\tlet last: CommitJob | undefined\n\tconst visit = (group: CommitGroup) => {\n\t\tfor (const child of group.children.sort((a, b) => a.order - b.order))\n\t\t\tvisit(child)\n\t\tfor (const job of group.jobs) {\n\t\t\tif (pending.delete(job) && isPresent(job.scope)) {\n\t\t\t\tconst enqueueCount = import.meta.env.DEV ? root._enqueueCount : undefined\n\t\t\t\tjob.run()\n\t\t\t\tif (import.meta.env.DEV && root._enqueueCount !== enqueueCount)\n\t\t\t\t\tlast = job\n\t\t\t}\n\t\t}\n\t}\n\tvisit(top)\n\treturn last\n}\n\nfunction capabilityMap(list: readonly Capability[] | undefined) {\n\tconst capabilities = new Map<string, Capability>()\n\tfor (const capability of list ?? []) {\n\t\tif (capabilities.has(capability.namespace))\n\t\t\tthrow new Error(`spa: duplicate capability ${capability.namespace}`)\n\t\tcapabilities.set(capability.namespace, capability)\n\t}\n\treturn capabilities\n}\nfunction registerPresence(\n\troot: Root,\n\tcapability: Capability,\n\tshared = false,\n): void {\n\tconst create = capability.presence\n\tif (!create) return\n\tif (root._presence) {\n\t\tif (!shared || root._presenceFactory !== create)\n\t\t\tthrow new Error(`spa: multiple presence coordinators`)\n\t} else {\n\t\troot._presence = create(root)\n\t\troot._presenceFactory = create\n\t}\n}\nexport function scopeCapabilities(scope: Scope): Map<string, Capability> {\n\treturn scope._options?._capabilities ?? scope._root._capabilities\n}\nexport function reportScopeError(scope: Scope, error: unknown): void {\n\tconst report = scopedErrorHandler(scope, error) ?? scope._root.error\n\ttry {\n\t\tfail(scope._root, error)\n\t} catch (failure) {\n\t\tscope._root._failure = undefined\n\t\treport(failure)\n\t}\n}\n\n/** Override root options for these children while sharing their parent's ownership. */\nexport function RootBoundary(\n\tprops: RootOptions & { children?: Children },\n): Children {\n\tconst scope = owner!\n\tconst { store, idPrefix, onError, capabilities } = props\n\tconst options = { ...scope._options }\n\tif (store !== undefined) options.store = store\n\tif (idPrefix !== undefined) options.idPrefix = idPrefix\n\tif (onError !== undefined) options.onError = onError\n\tif (capabilities !== undefined) {\n\t\toptions._capabilities = capabilityMap(capabilities)\n\t\tconst root = scope._root\n\t\tconst active = (root._boundaryCapabilities ??= new Map())\n\t\tfor (const capability of options._capabilities.values()) {\n\t\t\tregisterPresence(root, capability, true)\n\t\t\tactive.set(capability, (active.get(capability) ?? 0) + 1)\n\t\t\tscope._cleanups.add(() => {\n\t\t\t\tconst remaining = active.get(capability)! - 1\n\t\t\t\tif (remaining) active.set(capability, remaining)\n\t\t\t\telse active.delete(capability)\n\t\t\t})\n\t\t\troot._prepareCapability?.(capability)\n\t\t}\n\t}\n\tscope._options = options\n\treturn () => props.children\n}\n\nexport function createRoot(options: RootOptions = {}, server = false): Root {\n\tconst capabilities = capabilityMap(options.capabilities)\n\tconst root = {\n\t\t_capabilities: capabilities,\n\t\t_store: options.store ?? IMPLICIT.STORE,\n\t\t_prefix: options.idPrefix ?? `w${serial++}`,\n\t\t_id: 0,\n\t\t...createScope(),\n\t\t_queue: new Set(),\n\t\t_mounts: server ? undefined : [],\n\t} as unknown as Root\n\troot._root = root\n\troot.error =\n\t\toptions.onError ??\n\t\t((error) => {\n\t\t\tthrow error\n\t\t})\n\tfor (const capability of capabilities.values())\n\t\tregisterPresence(root, capability)\n\tconst hasWrites = () => root._queue.size || root._mounts!.length\n\tconst hasWork = () => hasWrites() || root._commits?.size\n\tlet flushPendingWrites: Cleanup | undefined\n\troot.flush = () => {\n\t\tconst nested = root._flushing\n\t\tif (!(nested ? hasWrites() : hasWork()) && !root._forms?.size) return\n\t\troot._flushing = true\n\t\ttry {\n\t\t\tif (nested) {\n\t\t\t\t// The outer flush owns commit dispatch. Mount callbacks can drain writes.\n\t\t\t\tflushPendingWrites?.()\n\t\t\t\treturn\n\t\t\t}\n\t\t\troot._failure = undefined\n\t\t\tlet passes = 0\n\t\t\tlet lastCommit: CommitJob | undefined\n\t\t\tconst checkLoop = () => {\n\t\t\t\tif (import.meta.env.DEV && ++passes > 100)\n\t\t\t\t\tthrow lastCommit?.loopError ?? new Error(`spa: update loop`)\n\t\t\t}\n\t\t\tconst runWriteBatch = () => {\n\t\t\t\tconst commits = new Map<Capability, Cleanup | undefined>()\n\t\t\t\tconst prepare = (capability: Capability) => {\n\t\t\t\t\tif (!commits.has(capability))\n\t\t\t\t\t\tcommits.set(capability, capability.beforeUpdate?.(root))\n\t\t\t\t}\n\t\t\t\tconst previous = root._prepareCapability\n\t\t\t\troot._prepareCapability = prepare\n\t\t\t\tlet formsReady = true\n\t\t\t\ttry {\n\t\t\t\t\tfor (const capability of capabilities.values()) prepare(capability)\n\t\t\t\t\tfor (const capability of root._boundaryCapabilities?.keys() ?? [])\n\t\t\t\t\t\tprepare(capability)\n\t\t\t\t\twhile (hasWrites()) {\n\t\t\t\t\t\tcheckLoop()\n\t\t\t\t\t\tfor (const run of [...root._queue])\n\t\t\t\t\t\t\tif (root._queue.delete(run)) run()\n\t\t\t\t\t\tfor (const run of root._mounts!.splice(0)) run()\n\t\t\t\t\t}\n\t\t\t\t\tfor (const restore of root._forms ?? [])\n\t\t\t\t\t\tif (!untrack(restore)) formsReady = false\n\t\t\t\t} finally {\n\t\t\t\t\troot._prepareCapability = previous\n\t\t\t\t\tfor (const commit of commits.values()) commit?.()\n\t\t\t\t}\n\t\t\t\treturn formsReady\n\t\t\t}\n\t\t\tdo {\n\t\t\t\tflushPendingWrites = runWriteBatch\n\t\t\t\tconst formsReady = runWriteBatch()\n\t\t\t\tflushPendingWrites = undefined\n\t\t\t\tif (!hasWrites()) {\n\t\t\t\t\t// Form event completion schedules a flush to restore the controls.\n\t\t\t\t\tif (!formsReady || !root._commits?.size) break\n\t\t\t\t\tcheckLoop()\n\t\t\t\t\tlastCommit = runCommits(root, root._commits) ?? lastCommit\n\t\t\t\t}\n\t\t\t} while (hasWork())\n\t\t\troot._failure = undefined\n\t\t} catch (error) {\n\t\t\tflushPendingWrites = undefined\n\t\t\tfail(root, error)\n\t\t} finally {\n\t\t\tif (!nested) root._flushing = false\n\t\t}\n\t}\n\treturn root\n}\n/** Return the atom.io store selected by the current owner. */\nexport function useStore(): RootStore {\n\treturn owner!._options?.store ?? owner!._root._store\n}\n/** Return atom.io disposal bound to the current root's store. */\nexport function useDisposal(): typeof disposeState {\n\treturn disposeFromStore.bind(null, useStore()) as typeof disposeState\n}\nexport function onCleanup(cleanup: Cleanup): void {\n\towner!._cleanups.add(cleanup)\n}\nexport function onMount(run: Cleanup): void {\n\tconst scope = owner!\n\tscope._root._mounts?.push(() => {\n\t\tif (!scope._dead)\n\t\t\twithin(scope, () => {\n\t\t\t\tuntrack(run)\n\t\t\t})\n\t})\n}\n/** Observe state during setup and apply changes after the root's writes. */\nexport function onCommit<T>(\n\tread: Accessor<T>,\n\tapply: (value: T, previous: T | undefined) => void | Cleanup,\n): void {\n\tconst scope = owner!\n\tconst root = scope._root\n\tif (!root._mounts) return\n\tconst pending = (root._commits ??= new Set())\n\tlet ran = false\n\tlet next: T\n\tlet previous: T | undefined\n\tlet cleanup: Cleanup | void\n\tconst clear = () => {\n\t\tconst release = cleanup\n\t\tcleanup = undefined\n\t\tif (release) untrack(release)\n\t}\n\tconst job: CommitJob = {\n\t\tscope,\n\t\torder: setupOrder++,\n\t\t// The registration stack identifies the component in a feedback loop.\n\t\tloopError: import.meta.env.DEV\n\t\t\t? new Error(`spa: onCommit update loop`)\n\t\t\t: undefined,\n\t\trun() {\n\t\t\twithin(scope, () => {\n\t\t\t\tuntrack(() => {\n\t\t\t\t\tclear()\n\t\t\t\t\tif (!isPresent(scope)) return\n\t\t\t\t\tconst old = previous\n\t\t\t\t\tprevious = next\n\t\t\t\t\tran = true\n\t\t\t\t\tcleanup = apply(next, old)\n\t\t\t\t\tif (scope._dead) clear()\n\t\t\t\t})\n\t\t\t})\n\t\t},\n\t}\n\tscope._cleanups.add(() => {\n\t\tpending.delete(job)\n\t\tclear()\n\t})\n\tobserve(scope, read, (value) => {\n\t\tnext = value\n\t\tif (!ran || !Object.is(value, previous)) pending.add(job)\n\t\telse pending.delete(job)\n\t})\n}\nexport function useId(): string {\n\tconst root = owner!._root\n\treturn `${owner!._options?.idPrefix ?? root._prefix}-${root._id++}`\n}\n\nexport function observe<T>(\n\tscope: Scope,\n\tread: Accessor<T>,\n\tapply: (value: T) => void,\n): void {\n\tconst subscriptions = new Map<Subscribe, Cleanup>()\n\tconst run = () => {\n\t\tif (!isPresent(scope)) return\n\t\tconst used = new Set<Subscribe>()\n\t\tconst previous = tracking\n\t\ttracking = (subscribe) => {\n\t\t\tused.add(subscribe)\n\t\t\tif (!subscriptions.has(subscribe))\n\t\t\t\tsubscriptions.set(\n\t\t\t\t\tsubscribe,\n\t\t\t\t\tsubscribe(() => {\n\t\t\t\t\t\tenqueue(scope, run)\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t}\n\t\tlet value: T\n\t\ttry {\n\t\t\tvalue = within(scope, read)\n\t\t} finally {\n\t\t\ttracking = previous\n\t\t\tfor (const [subscribe, unsubscribe] of subscriptions)\n\t\t\t\tif (!used.has(subscribe)) {\n\t\t\t\t\tunsubscribe()\n\t\t\t\t\tsubscriptions.delete(subscribe)\n\t\t\t\t}\n\t\t}\n\t\twithin(scope, () => {\n\t\t\tuntrack(() => {\n\t\t\t\tapply(value)\n\t\t\t})\n\t\t})\n\t}\n\tscope._updates.push(run)\n\tscope._cleanups.add(() => {\n\t\tscope._root._queue.delete(run)\n\t\tfor (const unsubscribe of subscriptions.values()) unsubscribe()\n\t})\n\trun()\n}\n\n/** Resolve a fixed family key in the current owner's store. */\nexport function resolveStateToken(token: any, key?: Canonical): any {\n\tconst store = useStore()\n\treturn token.type.endsWith(`_family`) ? findInStore(store, token, key!) : token\n}\n\n/** Capture a token for this instance. Change the component key to change its token. */\nexport function useGetter<T, E = never>(\n\ttoken: ReadableToken<T, any, E>,\n): Accessor<ViewOf<T | E>>\nexport function useGetter<T, K extends Canonical, E = never>(\n\tfamily: ReadableFamilyToken<T, K, E>,\n\tkey: NoInfer<K>,\n): Accessor<ViewOf<T | E>>\nexport function useGetter(token: any, key?: Canonical): Accessor<any> {\n\ttoken = resolveStateToken(token, key)\n\tconst root = owner!._root\n\tconst store = useStore()\n\tconst subscribe: Subscribe = (notify) =>\n\t\tsubscribeToState(store, token, `spa:${serial++}`, notify)\n\treturn () => {\n\t\tconst value = getFromStore(store, token)\n\t\troot._onRead?.(value, token, store)\n\t\ttracking?.(subscribe)\n\t\treturn value\n\t}\n}\nexport function useSetter<T>(\n\ttoken: WritableToken<T, any, any>,\n): (value: T | Setter<T>) => void\nexport function useSetter<T, K extends Canonical>(\n\tfamily: WritableFamilyToken<T, K, any>,\n\tkey: NoInfer<K>,\n): (value: T | Setter<T>) => void\nexport function useSetter(token: any, key?: Canonical): (value: any) => void {\n\ttoken = resolveStateToken(token, key)\n\tconst store = useStore()\n\treturn (value) => {\n\t\tsetIntoStore(store, token, value)\n\t}\n}\nexport function useTransaction<F extends (...args: any[]) => any>(\n\ttoken: TransactionToken<F>,\n): (...args: Parameters<F>) => ReturnType<F> {\n\treturn actUponStore(useStore(), token, `spa:${serial++}`)\n}\n\nconst refs = new WeakMap<RootStore, Map<string, object>>()\nexport function useRef<E extends Element>(\n\ttoken: RegularAtomToken<E | null>,\n): (element: E | null) => void\nexport function useRef<E extends Element, K extends Canonical>(\n\tfamily: RegularAtomFamilyToken<E | null, K>,\n\tkey: NoInfer<K>,\n): (element: E | null) => void\nexport function useRef<E extends Element>(\n\ttoken: any,\n\tkey?: Canonical,\n): (element: E | null) => void {\n\ttoken = resolveStateToken(token, key)\n\tconst store = useStore()\n\tconst owners = refs.get(store) ?? new Map<string, object>()\n\trefs.set(store, owners)\n\tconst identity = {}\n\tlet held: E | null = null\n\treturn (element) => {\n\t\tif (element) {\n\t\t\theld = element\n\t\t\towners.set(token.key, identity)\n\t\t\tsetIntoStore(store, token, element)\n\t\t} else if (owners.get(token.key) === identity) {\n\t\t\towners.delete(token.key)\n\t\t\tif (getFromStore(store, token) === held) setIntoStore(store, token, null)\n\t\t\theld = null\n\t\t}\n\t}\n}\nexport interface TimelineControls {\n\tgetCursor(): number\n\tgetLength(): number\n\tundo(): void\n\tredo(): void\n\tclear(): void\n\tgetTransaction(): { undo?: Cleanup; redo?: Cleanup }\n}\nexport function useTimeline<M extends TimelineManageable>(\n\ttoken: TimelineToken<M>,\n): TimelineControls\nexport function useTimeline<K extends Canonical, M extends TimelineManageable>(\n\tfamily: TimelineFamilyToken<K, M>,\n\tkey: NoInfer<K>,\n): TimelineControls\nexport function useTimeline(token: any, key?: Canonical): TimelineControls {\n\tconst store = useStore()\n\tconst selected: TimelineToken<any> =\n\t\ttoken.type === `timeline_family`\n\t\t\t? findTimelineInStore(store, token, key!)\n\t\t\t: token\n\tconst subscribe: Subscribe = (notify) =>\n\t\tsubscribeToTimeline(store, selected, `spa:${serial++}`, notify)\n\tconst read = () => {\n\t\tconst timeline = withdraw(store, selected)\n\t\ttracking?.(subscribe)\n\t\treturn timeline\n\t}\n\treturn {\n\t\tgetCursor: () => read().at,\n\t\tgetLength: () => read().history.length,\n\t\tundo: () => {\n\t\t\ttimeTravel(store, `undo`, selected)\n\t\t},\n\t\tredo: () => {\n\t\t\ttimeTravel(store, `redo`, selected)\n\t\t},\n\t\tclear: () => {\n\t\t\tclearTimelineInStore(store, selected)\n\t\t},\n\t\tgetTransaction: () => {\n\t\t\tconst timeline = read()\n\t\t\tconst controls: ReturnType<TimelineControls[`getTransaction`]> = {}\n\t\t\tfor (const direction of [`undo`, `redo`] as const) {\n\t\t\t\tconst group = getTimelineTransactionAtHead(timeline, direction)\n\t\t\t\tif (group)\n\t\t\t\t\tcontrols[direction] = () => {\n\t\t\t\t\t\ttimeTravelTransactionGroupInStore(store, direction, group)\n\t\t\t\t\t}\n\t\t\t}\n\t\t\treturn controls\n\t\t},\n\t}\n}\n\nexport function plain(value: Children): string {\n\tif (typeof value === `function`) return plain(value())\n\tif (Array.isArray(value)) return value.map(plain).join(``)\n\tif (value == null || typeof value === `boolean`) return ``\n\tif (import.meta.env.DEV && typeof value === `object`)\n\t\tthrow new Error(`spa: text required`)\n\t// oxlint-disable-next-line typescript/no-base-to-string -- Valid text children are primitives here; development rejects malformed object children.\n\treturn String(value)\n}\n\nexport function isPresent(scope: Scope): boolean {\n\tfor (let at: Scope | undefined = scope; at; at = at._parent)\n\t\tif (at._dead || at._exiting) return false\n\treturn true\n}\n"],"mappings":";;AA0HA,IAAW;AAEX,IAAI;AACJ,IAAI,SAAS;AACb,IAAI,aAAa;AAEjB,SAAS,mBACR,OACA,OAC4B;CAC5B,MAAM,UAAU,MAAM,MAAM;CAC5B,OAAO,WAAW,OAAO,GAAG,QAAQ,OAAO,KAAK,IAC7C,QAAQ,SACR,MAAM,UAAU;AACpB;AACA,SAAS,iBACR,OACA,OACA,SAAS,mBAAmB,OAAO,KAAK,GAChC;CACR,IAAI,QAAQ,MAAM,MAAM,WAAW;EAAE;EAAO;CAAO;CACnD,MAAM;AACP;AACA,SAAgB,OAAU,OAAc,KAAiB;CACxD,MAAM,WAAW;CACjB,QAAQ;CACR,IAAI;EACH,OAAO,IAAI;CACZ,SAAS,OAAO;EACf,iBAAiB,OAAO,KAAK;C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AK,MAAM,aAAa,CAAC,QAAQ,MAAM,GAAY;IAClD,MAAM,QAAQ,6BAA6B,UAAU,SAAS;IAC9D,IAAI,OACH,SAAS,mBAAmB;KAC3B,kCAAkC,OAAO,WAAW,KAAK;IAC1D;GACF;GACA,OAAO;EACR;CACD;AACD;AAEA,SAAgB,MAAM,OAAyB;CAC9C,IAAI,OAAO,UAAU,YAAY,OAAO,MAAM,MAAM,CAAC;CACrD,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,MAAM,IAAI,KAAK,CAAC,CAAC,KAAK,EAAE;CACzD,IAAI,SAAS,QAAQ,OAAO,UAAU,WAAW,OAAO;CAIxD,OAAO,OAAO,KAAK;AACpB;AAEA,SAAgB,UAAU,OAAuB;CAChD,KAAK,IAAI,KAAwB,OAAO,IAAI,KAAK,GAAG,SACnD,IAAI,GAAG,SAAS,GAAG,UAAU,OAAO;CACrC,OAAO;AACR"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DZ2_ORBITAL_LIGHTS, DZ2_ORBITAL_Y_ROTATION_RADIANS_PER_SECOND, createDz2OrbitalCamera, createDz2OrbitalModel, disposeDz2OrbitalModel } from "./brand-model.js";
|
|
2
|
-
import { f as onMount, u as onCleanup } from "./core-DrUd8x25.js";
|
|
3
|
-
import { h as PointLight, i as Canvas, l as Mesh, o as Group, t as AmbientLight } from "./three-CsZ6Od1C.js";
|
|
4
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-D1FWUMMC.js";
|
|
4
|
+
import { h as PointLight, i as Canvas, l as Mesh, o as Group, t as AmbientLight } from "./three-F5D1OnE9.js";
|
|
5
5
|
// src/BrandMarkScene.module.css
|
|
6
6
|
var BrandMarkScene_module_default = { "class": "atom-io-spa-BrandMarkScene-module-class" };
|
|
7
7
|
// src/BrandMarkScene.tsx
|
|
@@ -137,4 +137,4 @@ function BrandMarkScene(props) {
|
|
|
137
137
|
BrandMarkScene.spa = true;
|
|
138
138
|
export { BrandMarkScene };
|
|
139
139
|
|
|
140
|
-
//# sourceMappingURL=BrandMarkScene-
|
|
140
|
+
//# sourceMappingURL=BrandMarkScene-B282kBA3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrandMarkScene-
|
|
1
|
+
{"version":3,"file":"BrandMarkScene-B282kBA3.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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Q,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. */
|