@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-
|
|
1
|
+
{"version":3,"file":"identity-DWHH6jbd.js","names":[],"sources":["../../src/capabilities.ts","../../src/identity.ts"],"sourcesContent":["import type { Cleanup, Root, Scope } from \"./core.ts\"\nimport { isPresent, scopeCapabilities } from \"./core.ts\"\nimport type { ExitHandle, PresenceCoordinator } from \"./presence.ts\"\n\n/** Native renderers expose property access without importing capability engines. */\nexport interface CapabilityTarget {\n\tkind: string\n\tnode: unknown\n\tsuspend?(): Cleanup\n\tread?(key: string): unknown\n\twrite?(key: string, value: unknown): void\n\tlisten?(event: string, listener: () => void): Cleanup\n}\nexport interface CapabilityBinding {\n\texit?(props: Record<string, unknown>): ExitHandle | undefined\n\tresume?(): void\n\t/** Inline CSS before native style replacement, for restoring capability-owned values. */\n\tupdate(props: Record<string, unknown>, previousStyle?: string): void\n\tdispose(): void\n}\nexport interface Capability {\n\tnamespace: string\n\t/** Prepare a synchronous update batch and return its commit callback. */\n\tbeforeUpdate?(root: Root): Cleanup\n\tpresence?(root: Root): PresenceCoordinator\n\tscheduleFrame?(callback: (time: number) => void): Cleanup\n\t/** SPA supplies ownership for integrations that measure after mount or report async errors. */\n\tattach(target: CapabilityTarget, scope?: Scope): CapabilityBinding\n}\ntype EventHandler = (this: unknown, ...args: unknown[]) => unknown\n\nexport function capabilityNamespace(key: string): string | undefined {\n\tconst colon = key.indexOf(`:`)\n\tif (colon < 0) return undefined\n\tconst namespace = key.slice(0, colon)\n\treturn /^(xml|xmlns|xlink)$/.test(namespace) ? undefined : namespace\n}\nfunction requireCapability(\n\tcapabilities: Map<string, Capability>,\n\tnamespace: string,\n) {\n\tconst capability = capabilities.get(namespace)\n\tif (!capability)\n\t\tthrow new Error(\n\t\t\t`spa: capability \"${namespace}\" is not registered for this root`,\n\t\t)\n\treturn capability\n}\nexport function validateCapabilities(\n\tscope: Scope,\n\tprops: Record<string, unknown>,\n): void {\n\tconst capabilities = scopeCapabilities(scope)\n\tfor (const key of Object.keys(props)) {\n\t\tconst namespace = capabilityNamespace(key)\n\t\tif (namespace) requireCapability(capabilities, namespace)\n\t}\n}\n\n/** Separate framework properties from native attributes and own their bindings. */\nexport function capabilityProps(\n\tscope: Scope,\n\ttarget: CapabilityTarget,\n\tread?: () => Record<string, any>,\n\tapplyNative?: (props: Record<string, any>) => string | undefined,\n): (props: Record<string, any>) => Record<string, any> {\n\tconst root = scope._root\n\tconst bindings = new Map<Capability, CapabilityBinding>()\n\tlet handlers: WeakMap<EventHandler, EventHandler> | undefined\n\tconst event = (handler: EventHandler) => {\n\t\tconst cache = (handlers ??= new WeakMap())\n\t\tlet wrapped = cache.get(handler)\n\t\tif (!wrapped) {\n\t\t\twrapped = function (this: unknown, ...args: unknown[]) {\n\t\t\t\t// Presence may activate after this listener mounts.\n\t\t\t\tif (!root._presence || isPresent(scope)) return handler.apply(this, args)\n\t\t\t}\n\t\t\tcache.set(handler, wrapped)\n\t\t}\n\t\treturn wrapped\n\t}\n\n\tif (root._presence) root._presence.target(scope, target)\n\telse (scope._targets ??= new Set()).add(target)\n\tconst cleanup: Cleanup = () => {\n\t\tconst errors: unknown[] = []\n\t\tfor (const binding of [...bindings.values()].reverse()) {\n\t\t\ttry {\n\t\t\t\tbinding.dispose()\n\t\t\t} catch (error) {\n\t\t\t\terrors.push(error)\n\t\t\t}\n\t\t}\n\t\tbindings.clear()\n\t\tif (errors.length) throw new AggregateError(errors)\n\t}\n\tscope._cleanups.add(cleanup)\n\treturn (props) => {\n\t\tconst capabilities = scopeCapabilities(scope)\n\t\tconst native: Record<string, any> = {}\n\t\tconst groups = new Map<Capability, Record<string, unknown>>()\n\t\tfor (const key of Object.keys(props)) {\n\t\t\tconst namespace = capabilityNamespace(key)\n\t\t\tif (!namespace) {\n\t\t\t\tconst value = props[key]\n\t\t\t\tnative[key] =\n\t\t\t\t\tkey.startsWith(`on`) && typeof value === `function`\n\t\t\t\t\t\t? event(value)\n\t\t\t\t\t\t: value\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconst capability = requireCapability(capabilities, namespace)\n\t\t\tconst group = groups.get(capability) ?? {}\n\t\t\tgroup[key.slice(namespace.length + 1)] = props[key]\n\t\t\tgroups.set(capability, group)\n\t\t}\n\t\tconst previousStyle = applyNative?.(native)\n\t\tfor (const [capability, values] of groups) {\n\t\t\tlet binding = bindings.get(capability)\n\t\t\tif (!binding) {\n\t\t\t\tbinding = capability.attach(target, scope)\n\t\t\t\tbindings.set(capability, binding)\n\t\t\t\troot._presence?.bind(\n\t\t\t\t\tscope,\n\t\t\t\t\tbinding,\n\t\t\t\t\tread ?? (() => props),\n\t\t\t\t\tcapability.namespace,\n\t\t\t\t)\n\t\t\t}\n\t\t\tif (previousStyle !== undefined) binding.update(values, previousStyle)\n\t\t\telse binding.update(values)\n\t\t}\n\t\tfor (const [capability, binding] of bindings)\n\t\t\tif (!groups.has(capability)) {\n\t\t\t\tbindings.delete(capability)\n\t\t\t\troot._presence?.unbind(binding)\n\t\t\t\tbinding.dispose()\n\t\t\t}\n\t\treturn native\n\t}\n}\n","import type { Canonical } from \"atom.io/foundations/canonical\"\nimport { packCanonical } from \"atom.io/foundations/canonical\"\n\nimport type { Children, SpaElement } from \"./core.ts\"\n\ntype Props = SpaElement[`props`]\ntype Key = Canonical | undefined\ntype Identity = string | number\n\nfunction childProps(value: Children): Props | undefined {\n\treturn (value as SpaElement | null)?.props\n}\n\nfunction hasKey(value: Children): boolean {\n\tif (Array.isArray(value)) return value.some(hasKey)\n\tconst props = childProps(value)\n\treturn props !== undefined && Object.hasOwn(props, `key`)\n}\n\n/** Direct output opts into key tracking when it first mounts. */\nexport function trackKeys(value: Children): Children {\n\treturn hasKey(value) ? () => value : value\n}\n\nexport function identifyChildren(\n\toutput: Children,\n\tduplicate = `spa: duplicate key`,\n): { value: Children; key: Key; id: Identity }[] {\n\tconst values = ([output] as unknown[]).flat(Infinity) as Children[]\n\tconst seen = new Set<string>()\n\treturn values.map((value, index) => {\n\t\tconst key: Key = childProps(value)?.[`key`]\n\t\tif (key === undefined) return { value, key, id: index }\n\t\tconst id = packCanonical(key)\n\t\tif (seen.has(id)) throw new Error(duplicate)\n\t\tseen.add(id)\n\t\treturn { value, key, id }\n\t})\n}\n"],"mappings":";;;AA+BA,SAAgB,oBAAoB,KAAiC;CACpE,MAAM,QAAQ,IAAI,QAAQ,GAAG;CAC7B,IAAI,QAAQ,GAAG,OAAO,KAAA;CACtB,MAAM,YAAY,IAAI,MAAM,GAAG,KAAK;CACpC,OAAO,sBAAsB,KAAK,SAAS,IAAI,KAAA,IAAY;AAC5D;AACA,SAAS,kBACR,cACA,WAC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QAAQ;AACtC;AAEA,SAAgB,iBACf,QACA,YAAY,sBACoC;CAChD,MAAM,SAAU,CAAC,MAAM,CAAC,CAAe,KAAK,KAAQ;CACpD,MAAM,uBAAO,IAAI,IAAY;CAC7B,OAAO,OAAO,KAAK,OAAO,UAAU;EACnC,MAAM,MAAW,WAAW,KAAK,CAAC,GAAG;EACrC,IAAI,QAAQ,KAAA,GAAW,OAAO;GAAE;GAAO;GAAK,IAAI;EAAM;EACtD,MAAM,KAAK,cAAc,GAAG;EAC5B,IAAI,KAAK,IAAI,EAAE,GAAG,MAAM,IAAI,MAAM,SAAS;EAC3C,KAAK,IAAI,EAAE;EACX,OAAO;GAAE;GAAO;GAAK;EAAG;CACzB,CAAC;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as useSetter, E as useTransaction, S as useRef, T as useTimeline, b as useGetter, d as onCommit, f as onMount, t as RootBoundary, u as onCleanup, w as useStore, x as useId, y as useDisposal } from "./core-
|
|
2
|
-
import { n as render, t as hydrate } from "./dom-
|
|
3
|
-
import { t as Fragment } from "./jsx-runtime-
|
|
4
|
-
import { t as useLoadable } from "./src-
|
|
1
|
+
import { C as useSetter, E as useTransaction, S as useRef, T as useTimeline, b as useGetter, d as onCommit, f as onMount, t as RootBoundary, u as onCleanup, w as useStore, x as useId, y as useDisposal } from "./core-D1FWUMMC.js";
|
|
2
|
+
import { n as render, t as hydrate } from "./dom-C1cVf5Vm.js";
|
|
3
|
+
import { t as Fragment } from "./jsx-runtime-B2XxfA3E.js";
|
|
4
|
+
import { t as useLoadable } from "./src-By4JY4qf.js";
|
|
5
5
|
export { Fragment, RootBoundary as Root, hydrate, onCleanup, onCommit, onMount, render, useDisposal, useGetter, useId, useLoadable, useRef, useSetter, useStore, useTimeline, useTransaction };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-runtime-
|
|
1
|
+
{"version":3,"file":"jsx-runtime-B2XxfA3E.js","names":[],"sources":["../../src/props.ts","../../src/jsx-runtime.ts"],"sourcesContent":["import type { Canonical } from \"atom.io/foundations/canonical\"\n\nimport type { SpaElement } from \"./core.ts\"\n\ntype Props = SpaElement[`props`]\ntype FixedKey = { value: Canonical | undefined; present: boolean }\n\nfunction liveProps(values: () => Props[], fixedKey?: FixedKey): Props {\n\tconst source = (name: PropertyKey) =>\n\t\tvalues()\n\t\t\t.reverse()\n\t\t\t.find((props) => Object.hasOwn(props, name))\n\tconst has = (_: Props, name: PropertyKey): boolean =>\n\t\tfixedKey && name === `key` ? fixedKey.present : source(name) !== undefined\n\treturn new Proxy(\n\t\t{},\n\t\t{\n\t\t\thas,\n\t\t\tget(_, name) {\n\t\t\t\tif (fixedKey && name === `key`) return fixedKey.value\n\t\t\t\tconst props = source(name)\n\t\t\t\treturn props && Reflect.get(props, name)\n\t\t\t},\n\t\t\townKeys() {\n\t\t\t\tconst keys = new Set(values().flatMap(Object.keys))\n\t\t\t\tif (fixedKey?.present) keys.add(`key`)\n\t\t\t\telse if (fixedKey) keys.delete(`key`)\n\t\t\t\treturn [...keys]\n\t\t\t},\n\t\t\tgetOwnPropertyDescriptor(_, name) {\n\t\t\t\tif (has(_, name)) return { enumerable: true, configurable: true }\n\t\t\t},\n\t\t},\n\t)\n}\n\n/** Preserve lazy props and spread precedence, including keys added by later updates. */\nexport function merge(...sources: (Props | (() => Props))[]): Props {\n\treturn liveProps(() =>\n\t\tsources.map(\n\t\t\t(source) => (typeof source === `function` ? source() : source) ?? {},\n\t\t),\n\t)\n}\n\n/** Expose the first key while leaving data props live, including through spreads. */\nexport function instanceProps(\n\tread: () => Props,\n\tkey: Canonical | undefined,\n): Props {\n\treturn liveProps(() => [read()], {\n\t\tvalue: key,\n\t\tpresent: key !== undefined || Object.hasOwn(read(), `key`),\n\t})\n}\n","import type { Canonical } from \"atom.io/foundations/canonical\"\n\nimport type { Children, Component, SpaElement } from \"./core.ts\"\nimport type { HTMLAttributes, NativeElements } from \"./jsx-types.d.ts\"\nimport { merge } from \"./props.ts\"\n\nexport type {\n\tAriaAttributes,\n\tDOMAttributes,\n\tEventAttributes,\n\tEventHandler,\n\tHTMLAttributes,\n\tRef,\n\tSVGAttributes,\n\tTargetedEvent,\n} from \"./jsx-types.d.ts\"\nexport { merge } from \"./props.ts\"\n\n/** Optional integrations augment attributes without changing element identity. */\n// oxlint-disable-next-line typescript/no-empty-interface -- Optional integrations augment this declaration.\nexport interface CapabilityAttributes<Kind extends string = string> {}\n\nexport const Fragment = (props: { children?: Children }): Children =>\n\tprops.children\nexport function jsx(\n\ttype: SpaElement[`type`],\n\tprops: SpaElement[`props`] | null,\n\tkey?: Canonical,\n): SpaElement {\n\treturn {\n\t\ttype,\n\t\tprops: key === undefined ? (props ?? {}) : merge(props ?? {}, { key }),\n\t}\n}\nexport const jsxs = jsx\nexport const jsxDEV = jsx\n\nexport namespace JSX {\n\texport type Element = SpaElement\n\texport type ElementType = keyof IntrinsicElements | Component\n\texport interface ElementChildrenAttribute {\n\t\tchildren: {}\n\t}\n\texport interface IntrinsicAttributes {\n\t\tkey?: Canonical | undefined\n\t}\n\t/** Augment this interface to declare attributes for registered custom elements. */\n\texport interface IntrinsicElements extends NativeElements {\n\t\t[tag: `${string}-${string}`]: HTMLAttributes<HTMLElement>\n\t}\n}\n"],"mappings":";AAOA,SAAS,UAAU,QAAuB,UAA4B;CACrE,MAAM,UAAU,SACf,OAAO,CAAC,CACN,QAAQ,CAAC,CACT,MAAM,UAAU,OAAO,OAAO,OAAO,IAAI,CAAC;CAC7C,MAAM,OAAO,GAAU,SACtB,YAAY,SAAS,QAAQ,SAAS,UAAU,OAAO,IAAI,MAAM,KAAA;CAClE,OAAO,IAAI,MACV,CAAC,GACD;EACC;EACA,IAAI,GAAG,MAAM;GACZ,IAAI,YAAY,SAAS,OAAO,OAAO,SAAS;GAChD,MAAM,QAAQ,OAAO,IAAI;GACzB,OAAO,SAAS,QAAQ,IAAI,OAAO,IAAI;EACxC;EACA,UAAU;GACT,MAAM,OAAO,IAAI,IAAI,OAAO,CAAC,CAAC,QAAQ,OAAO,IAAI,CAAC;GAClD,IAAI,UAAU,SAAS,KAAK,IAAI,KAAK;QAChC,IAAI,UAAU,KAAK,OAAO,KAAK;GACpC,OAAO,CAAC,GAAG,IAAI;EAChB;EACA,yBAAyB,GAAG,MAAM;GACjC,IAAI,IAAI,GAAG,IAAI,GAAG,OAAO;IAAE,YAAY;IAAM,cAAc;GAAK;EACjE;CACD,CACD;AACD;;AAGA,SAAgB,MAAM,GAAG,SAA2C;CACnE,OAAO,gBACN,QAAQ,KACN,YAAY,OAAO,WAAW,aAAa,OAAO,IAAI,WAAW,CAAC,CACpE,CACD;AACD;;AAGA,SAAgB,cACf,MACA,KACQ;CACR,OAAO,gBAAgB,CAAC,KAAK,CAAC,GAAG;EAChC,OAAO;EACP,SAAS,QAAQ,KAAA,KAAa,OAAO,OAAO,KAAK,GAAG,KAAK;CAC1D,CAAC;AACF;;AChCA,MAAa,YAAY,UACxB,MAAM;AACP,SAAgB,IACf,MACA,OACA,KACa;CACb,OAAO;EACN;EACA,OAAO,QAAQ,KAAA,IAAa,SAAS,CAAC,IAAK,MAAM,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC;CACtE;AACD;AACA,MAAa,OAAO;AACpB,MAAa,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as Fragment, n as jsx, r as jsxDEV, i as jsxs, o as merge } from "./jsx-runtime-
|
|
1
|
+
export { t as Fragment, n as jsx, r as jsxDEV, i as jsxs, o as merge } from "./jsx-runtime-B2XxfA3E.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as capabilityProps } from "./identity-B8wTFkyW.js";
|
|
2
|
-
import { f as onMount, p as owner, u as onCleanup } from "./core-DrUd8x25.js";
|
|
3
|
-
import { n as jsx } from "./jsx-runtime-BGDPK50B.js";
|
|
4
|
-
import { bindScene, createSceneRenderer, sceneComponent } from "./renderer.js";
|
|
5
1
|
import Konva from "konva";
|
|
2
|
+
import { i as capabilityProps } from "./identity-DWHH6jbd.js";
|
|
3
|
+
import { f as onMount, p as owner, u as onCleanup } from "./core-D1FWUMMC.js";
|
|
4
|
+
import { n as jsx } from "./jsx-runtime-B2XxfA3E.js";
|
|
5
|
+
import { bindScene, createSceneRenderer, sceneComponent } from "./renderer.js";
|
|
6
6
|
// src/konva.ts
|
|
7
7
|
const constructors = {
|
|
8
8
|
Layer: Konva.Layer,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as within, c as isPresent, f as onMount, h as reportScopeError, i as dispose, o as fail, s as invalidate, v as untrack } from "./core-DrUd8x25.js";
|
|
2
1
|
import { acquireProjectionNode, animate, cancelFrame, frame, handOffElementState, hover, keyframes, motionValue, press, readStyleValue, styleEffect, visualElementStore } from "motion";
|
|
2
|
+
import { D as within, c as isPresent, f as onMount, h as reportScopeError, i as dispose, o as fail, s as invalidate, v as untrack } from "./core-D1FWUMMC.js";
|
|
3
3
|
// src/motion-layout.ts
|
|
4
4
|
let serial = 0;
|
|
5
5
|
function createLayoutController(root, options) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as capabilityProps, t as identifyChildren } from "./identity-
|
|
2
|
-
import { D as within, _ as scopeCapabilities, c as isPresent, h as reportScopeError, i as dispose, l as observe, n as createRoot, o as fail, p as owner, r as createScope, s as invalidate, v as untrack } from "./core-
|
|
1
|
+
import { i as capabilityProps, t as identifyChildren } from "./identity-DWHH6jbd.js";
|
|
2
|
+
import { D as within, _ as scopeCapabilities, c as isPresent, h as reportScopeError, i as dispose, l as observe, n as createRoot, o as fail, p as owner, r as createScope, s as invalidate, v as untrack } from "./core-D1FWUMMC.js";
|
|
3
3
|
import { hotRoot, trackRoot } from "./hot.js";
|
|
4
|
-
import { a as instanceProps, t as Fragment } from "./jsx-runtime-
|
|
4
|
+
import { a as instanceProps, t as Fragment } from "./jsx-runtime-B2XxfA3E.js";
|
|
5
5
|
// src/renderer.ts
|
|
6
6
|
/** A scene renderer shares SPA's owner, store, scheduler, and component lifecycle. */
|
|
7
7
|
function createSceneRenderer(host) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as validateCapabilities, n as trackKeys, r as capabilityNamespace, t as identifyChildren } from "./identity-
|
|
2
|
-
import { D as within, i as dispose, m as plain, n as createRoot, r as createScope, v as untrack } from "./core-
|
|
3
|
-
import { a as instanceProps, t as Fragment } from "./jsx-runtime-
|
|
1
|
+
import { a as validateCapabilities, n as trackKeys, r as capabilityNamespace, t as identifyChildren } from "./identity-DWHH6jbd.js";
|
|
2
|
+
import { D as within, i as dispose, m as plain, n as createRoot, r as createScope, v as untrack } from "./core-D1FWUMMC.js";
|
|
3
|
+
import { a as instanceProps, t as Fragment } from "./jsx-runtime-B2XxfA3E.js";
|
|
4
4
|
// src/server-renderer.ts
|
|
5
5
|
const escape = (value) => String(value).replace(/[&<>"']/g, (char) => ({
|
|
6
6
|
"&": `&`,
|
|
@@ -77,4 +77,4 @@ function renderToStringWithReads(setup, options = {}, onRead) {
|
|
|
77
77
|
}
|
|
78
78
|
export { renderToStringWithReads as t };
|
|
79
79
|
|
|
80
|
-
//# sourceMappingURL=server-renderer-
|
|
80
|
+
//# sourceMappingURL=server-renderer-B-L5tNg7.js.map
|
package/dist/development/{server-renderer-zAqEL1g1.js.map → server-renderer-B-L5tNg7.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-renderer-
|
|
1
|
+
{"version":3,"file":"server-renderer-B-L5tNg7.js","names":[],"sources":["../../src/server-renderer.ts"],"sourcesContent":["import type { ReadableToken } from \"atom.io\"\nimport type { Canonical } from \"atom.io/foundations/canonical\"\nimport type { RootStore } from \"atom.io/internal\"\n\nimport { capabilityNamespace, validateCapabilities } from \"./capabilities.ts\"\nimport type { Children, RootOptions, Scope } from \"./core.ts\"\nimport {\n\tcreateRoot,\n\tcreateScope,\n\tdispose,\n\tplain,\n\tuntrack,\n\twithin,\n} from \"./core.ts\"\nimport { identifyChildren, trackKeys } from \"./identity.ts\"\nimport { Fragment } from \"./jsx-runtime.ts\"\nimport { instanceProps } from \"./props.ts\"\n\nconst escape = (value: unknown): string =>\n\tString(value).replace(\n\t\t/[&<>\"']/g,\n\t\t(char) =>\n\t\t\t({ \"&\": `&`, \"<\": `<`, \">\": `>`, '\"': `"`, \"'\": `'` })[\n\t\t\t\tchar\n\t\t\t]!,\n\t)\nconst voidTags =\n\t/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/\nconst booleans = new Set(\n\t`allowfullscreen async autofocus autoplay checked controls credentialless default defer disabled disablepictureinpicture disableremoteplayback formnovalidate inert ismap itemscope loop multiple muted nomodule novalidate open playsinline readonly required reversed selected shadowrootclonable shadowrootdelegatesfocus shadowrootserializable`.split(\n\t\t` `,\n\t),\n)\nfunction stringify(\n\tvalue: Children,\n\towner: Scope,\n\tnamespace = `html`,\n\tselectValue?: string | number,\n\tinitialKey?: Canonical,\n): string {\n\tif (typeof value === `function`) {\n\t\tconst values = within(owner, () => untrack(() => identifyChildren(value())))\n\t\treturn (\n\t\t\t`<!--{-->` +\n\t\t\tvalues\n\t\t\t\t.map(\n\t\t\t\t\t({ value: child, key }) =>\n\t\t\t\t\t\t`<!--[-->${within(owner, () => stringify(child, createScope(owner), namespace, selectValue, key))}<!--]-->`,\n\t\t\t\t)\n\t\t\t\t.join(``) +\n\t\t\t`<!--}-->`\n\t\t)\n\t}\n\tif (Array.isArray(value))\n\t\treturn value\n\t\t\t.map((child) => stringify(child, owner, namespace, selectValue))\n\t\t\t.join(``)\n\tif (value == null || typeof value === `boolean`) return ``\n\tif (typeof value !== `object`) return `<!--t-->${escape(value)}`\n\tif (!(`type` in value) || !(`props` in value))\n\t\tthrow new TypeError(`spa: invalid child`)\n\tconst { type, props } = value\n\tif (!type || type === Fragment)\n\t\treturn stringify(() => props[`children`], owner, namespace, selectValue)\n\tif (typeof type === `function`) {\n\t\tconst childOwner = createScope(owner)\n\t\treturn within(childOwner, () =>\n\t\t\tstringify(\n\t\t\t\ttrackKeys(untrack(() => type(instanceProps(() => props, initialKey)))),\n\t\t\t\tchildOwner,\n\t\t\t\tnamespace,\n\t\t\t\tselectValue,\n\t\t\t),\n\t\t)\n\t}\n\tif (!/^[A-Za-z][\\w.:-]*$/.test(type)) throw new Error(`spa: invalid tag`)\n\tif (type === `astro-slot`)\n\t\treturn `<astro-slot${props[`name`] ? ` name=\"${escape(props[`name`])}\"` : ``}>${props[`innerHTML`] ?? ``}</astro-slot>`\n\tconst ns = type === `svg` ? `svg` : namespace\n\tvalidateCapabilities(owner, props)\n\tlet attrs = ``\n\tlet textValue: string | number | undefined\n\tfor (let key of Object.keys(props)) {\n\t\tif (\n\t\t\tcapabilityNamespace(key) !== undefined ||\n\t\t\tkey === `children` ||\n\t\t\tkey === `ref` ||\n\t\t\tkey === `key` ||\n\t\t\tkey.startsWith(`on`)\n\t\t)\n\t\t\tcontinue\n\t\tif (\n\t\t\t/^(innerHTML|outerHTML|textContent|innerText|dangerouslySetInnerHTML)$/.test(\n\t\t\t\tkey,\n\t\t\t)\n\t\t)\n\t\t\tthrow new Error(`spa: owned content`)\n\t\tlet attribute = props[key]\n\t\tif (ns === `html`) {\n\t\t\tif (key === `defaultValue` && (type === `input` || type === `textarea`)) {\n\t\t\t\tif (props[`value`] != null) continue\n\t\t\t\tkey = `value`\n\t\t\t} else if (key === `defaultChecked` && type === `input`) {\n\t\t\t\tif (props[`checked`] != null) continue\n\t\t\t\tkey = `checked`\n\t\t\t}\n\t\t}\n\t\tif (key === `className`) key = `class`\n\t\tif (key === `htmlFor`) key = `for`\n\t\tif (!/^[^\\s\"'<>/=]+$/.test(key)) throw new Error(`spa: invalid attribute`)\n\t\tif (key === `value` && (type === `select` || type === `textarea`)) {\n\t\t\ttextValue = attribute ?? textValue\n\t\t\tcontinue\n\t\t}\n\t\tif (key === `style` && attribute != null && typeof attribute !== `string`)\n\t\t\tthrow new TypeError(`spa: CSS string required`)\n\t\tconst boolean =\n\t\t\tns === `html` &&\n\t\t\t(booleans.has(key.toLowerCase()) ||\n\t\t\t\t(/^(capture|download|hidden)$/.test(key) &&\n\t\t\t\t\ttypeof attribute === `boolean`))\n\t\tif (attribute == null || (boolean && !attribute)) continue\n\t\tattrs += boolean ? ` ${key}=\"\"` : ` ${key}=\"${escape(attribute)}\"`\n\t}\n\tif (\n\t\ttype === `option` &&\n\t\tselectValue !== undefined &&\n\t\tString(props[`value`]) === String(selectValue)\n\t)\n\t\tattrs += ` selected=\"\"`\n\tif (ns === `html` && voidTags.test(type)) return `<${type}${attrs}>`\n\tif (ns === `html` && /^(textarea|title|style|script)$/.test(type)) {\n\t\tlet text = plain(\n\t\t\ttype === `textarea` ? (textValue ?? props[`children`]) : props[`children`],\n\t\t)\n\t\tif (type === `textarea` && text.startsWith(`\\n`)) text = `\\n${text}`\n\t\tif (/^(script|style)$/.test(type) && new RegExp(`</${type}`, `i`).test(text))\n\t\t\tthrow new Error(`spa: unsafe raw text`)\n\t\treturn `<${type}${attrs}>${/^(script|style)$/.test(type) ? text : escape(text)}</${type}>`\n\t}\n\tconst children = stringify(\n\t\t() => props[`children`],\n\t\towner,\n\t\ttype === `foreignObject` ? `html` : ns,\n\t\ttype === `select` ? textValue : selectValue,\n\t)\n\treturn `<${type}${attrs}>${children}</${type}>`\n}\n\nexport function renderToStringWithReads(\n\tsetup: () => Children,\n\toptions: RootOptions = {},\n\tonRead?: (\n\t\tvalue: unknown,\n\t\ttoken: ReadableToken<unknown>,\n\t\tstore: RootStore,\n\t) => void,\n): string {\n\tconst root = createRoot(options, true)\n\troot._onRead = onRead\n\tif (/--|[<>]/.test(root._prefix)) throw new Error(`spa: invalid idPrefix`)\n\ttry {\n\t\treturn `<!--w:${root._prefix}-->${within(root, () => stringify(trackKeys(untrack(setup)), root))}<!--/w-->`\n\t} finally {\n\t\tdispose(root)\n\t}\n}\n"],"mappings":";;;;AAkBA,MAAM,UAAU,UACf,OAAO,KAAK,CAAC,CAAC,QACb,aACC,UACC;CAAE,KAA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AAO,UAAU,kCAAkC,KAAK,IAAI,GAAG;EAClE,IAAI,OAAO,MACV,SAAS,aAAc,aAAa,MAAM,cAAe,MAAM,WAChE;EACA,IAAI,SAAS,cAAc,KAAK,WAAW,IAAI,GAAG,OAAO,KAAK;EAC9D,IAAI,mBAAmB,KAAK,IAAI,KAAK,IAAI,OAAO,KAAK,QAAQ,GAAG,CAAC,CAAC,KAAK,IAAI,GAC1E,MAAM,IAAI,MAAM,sBAAsB;EACvC,OAAO,IAAI,OAAO,MAAM,GAAG,mBAAmB,KAAK,IAAI,IAAI,OAAO,OAAO,IAAI,EAAE,IAAI,KAAK;CACzF;CACA,MAAM,WAAW,gBACV,MAAM,aACZ,OACA,SAAS,kBAAkB,SAAS,IACpC,SAAS,WAAW,YAAY,WACjC;CACA,OAAO,IAAI,OAAO,MAAM,GAAG,SAAS,IAAI,KAAK;AAC9C;AAEA,SAAgB,wBACf,OACA,UAAuB,CAAC,GACxB,QAKS;CACT,MAAM,OAAO,WAAW,SAAS,IAAI;CACrC,KAAK,UAAU;CACf,IAAI,UAAU,KAAK,KAAK,OAAO,GAAG,MAAM,IAAI,MAAM,uBAAuB;CACzE,IAAI;EACH,OAAO,SAAS,KAAK,QAAQ,KAAK,OAAO,YAAY,UAAU,UAAU,QAAQ,KAAK,CAAC,GAAG,IAAI,CAAC,EAAE;CAClG,UAAU;EACT,QAAQ,IAAI;CACb;AACD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as renderToStringWithReads } from "./server-renderer-
|
|
1
|
+
import { t as renderToStringWithReads } from "./server-renderer-B-L5tNg7.js";
|
|
2
2
|
// src/server.ts
|
|
3
3
|
function renderToString(setup, options = {}) {
|
|
4
4
|
return renderToStringWithReads(setup, options);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as useGetter, g as resolveStateToken, w as useStore } from "./core-
|
|
1
|
+
import { b as useGetter, g as resolveStateToken, w as useStore } from "./core-D1FWUMMC.js";
|
|
2
2
|
import { withdraw } from "atom.io/internal";
|
|
3
3
|
// src/use-loadable.ts
|
|
4
4
|
function useLoadable(...params) {
|
|
@@ -35,4 +35,4 @@ function useLoadable(...params) {
|
|
|
35
35
|
}
|
|
36
36
|
export { useLoadable as t };
|
|
37
37
|
|
|
38
|
-
//# sourceMappingURL=src-
|
|
38
|
+
//# sourceMappingURL=src-By4JY4qf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"src-
|
|
1
|
+
{"version":3,"file":"src-By4JY4qf.js","names":[],"sources":["../../src/use-loadable.ts"],"sourcesContent":["import type {\n\tLoadable,\n\tReadableFamilyToken,\n\tReadableToken,\n\tViewOf,\n} from \"atom.io\"\nimport type { Canonical } from \"atom.io/foundations/canonical\"\nimport { withdraw } from \"atom.io/internal\"\n\nimport { type Accessor, resolveStateToken, useGetter, useStore } from \"./core.ts\"\n\nexport type LoadableValue<T> = { loading: boolean; value: T }\n\nexport function useLoadable<T, E>(\n\ttoken: ReadableToken<Loadable<T>, any, E>,\n): Accessor<`LOADING` | LoadableValue<ViewOf<T | E>>>\nexport function useLoadable<T, K extends Canonical, E>(\n\ttoken: ReadableFamilyToken<Loadable<T>, K, E>,\n\tkey: NoInfer<K>,\n): Accessor<`LOADING` | LoadableValue<ViewOf<T | E>>>\nexport function useLoadable<T, E>(\n\ttoken: ReadableToken<Loadable<T>, any, E>,\n\tfallback: NoInfer<T>,\n): Accessor<LoadableValue<ViewOf<T>> & { error?: E }>\nexport function useLoadable<T, K extends Canonical, E>(\n\ttoken: ReadableFamilyToken<Loadable<T>, K, E>,\n\tkey: NoInfer<K>,\n\tfallback: NoInfer<T>,\n): Accessor<LoadableValue<ViewOf<T>> & { error?: E }>\nexport function useLoadable(\n\t...params:\n\t\t| [ReadableToken<any, any, any>]\n\t\t| [ReadableToken<any, any, any>, unknown]\n\t\t| [ReadableFamilyToken<any, Canonical, any>, Canonical]\n\t\t| [ReadableFamilyToken<any, Canonical, any>, Canonical, unknown]\n): Accessor<`LOADING` | (LoadableValue<unknown> & { error?: unknown })> {\n\tconst store = useStore()\n\tconst [token] = params\n\tconst family = token.type.endsWith(`_family`)\n\tconst selected = resolveStateToken(token, params[1] as Canonical)\n\tconst getValue = useGetter(selected)\n\tconst fallbackIndex = family ? 2 : 1\n\tconst fallback = params[fallbackIndex]\n\tconst hasFallback = params.length > fallbackIndex\n\tlet available = hasFallback\n\tlet previous = fallback\n\tlet error: unknown\n\treturn () => {\n\t\tconst value = getValue()\n\t\tconst loading = value instanceof Promise\n\t\tif (!loading) {\n\t\t\tprevious = value\n\t\t\tavailable = true\n\t\t\tconst state = withdraw(store, selected)\n\t\t\terror =\n\t\t\t\thasFallback &&\n\t\t\t\t`catch` in state &&\n\t\t\t\tstate.catch.some((ErrorType) => value instanceof ErrorType)\n\t\t\t\t\t? value\n\t\t\t\t\t: undefined\n\t\t}\n\t\tif (!available) return `LOADING`\n\t\treturn error\n\t\t\t? { loading, value: fallback, error }\n\t\t\t: { loading, value: previous }\n\t}\n}\n"],"mappings":";;;AA6BA,SAAgB,YACf,GAAG,QAKoE;CACvE,MAAM,QAAQ,SAAS;CACvB,MAAM,CAAC,SAAS;CAChB,MAAM,SAAS,MAAM,KAAK,SAAS,SAAS;CAC5C,MAAM,WAAW,kBAAkB,OAAO,OAAO,EAAe;CAChE,MAAM,WAAW,UAAU,QAAQ;CACnC,MAAM,gBAAgB,SAAS,IAAI;CACnC,MAAM,WAAW,OAAO;CACxB,MAAM,cAAc,OAAO,SAAS;CACpC,IAAI,YAAY;CAChB,IAAI,WAAW;CACf,IAAI;CACJ,aAAa;EACZ,MAAM,QAAQ,SAAS;EACvB,MAAM,UAAU,iBAAiB;EACjC,IAAI,CAAC,SAAS;GACb,WAAW;GACX,YAAY;GACZ,MAAM,QAAQ,SAAS,OAAO,QAAQ;GACtC,QACC,eACA,WAAW,SACX,MAAM,MAAM,MAAM,cAAc,iBAAiB,SAAS,IACvD,QACA,KAAA;EACL;EACA,IAAI,CAAC,WAAW,OAAO;EACvB,OAAO,QACJ;GAAE;GAAS,OAAO;GAAU;EAAM,IAClC;GAAE;GAAS,OAAO;EAAS;CAC/B;AACD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { D as within, c as isPresent, f as onMount, h as reportScopeError, p as owner, u as onCleanup } from "./core-
|
|
2
|
-
import { n as jsx } from "./jsx-runtime-BGDPK50B.js";
|
|
3
|
-
import { bindScene, createSceneRenderer, onSceneFrame, sceneComponent } from "./renderer.js";
|
|
1
|
+
import { D as within, c as isPresent, f as onMount, h as reportScopeError, p as owner, u as onCleanup } from "./core-D1FWUMMC.js";
|
|
4
2
|
import * as THREE from "three";
|
|
3
|
+
import { n as jsx } from "./jsx-runtime-B2XxfA3E.js";
|
|
4
|
+
import { bindScene, createSceneRenderer, onSceneFrame, sceneComponent } from "./renderer.js";
|
|
5
5
|
// src/three-events.ts
|
|
6
6
|
const suspended = /* @__PURE__ */ new WeakSet();
|
|
7
7
|
function suspendThree(node) {
|
|
@@ -524,4 +524,4 @@ const BufferGeometry = sceneComponent(`BufferGeometry`);
|
|
|
524
524
|
const LineBasicMaterial = sceneComponent(`LineBasicMaterial`);
|
|
525
525
|
export { renderer as _, DirectionalLight as a, LineSegments as c, MeshNormalMaterial as d, MeshStandardMaterial as f, SphereGeometry as g, PointLight as h, Canvas as i, Mesh as l, PlaneGeometry as m, BoxGeometry as n, Group as o, PerspectiveCamera as p, BufferGeometry as r, LineBasicMaterial as s, AmbientLight as t, MeshBasicMaterial as u, createThreeEvents as v };
|
|
526
526
|
|
|
527
|
-
//# sourceMappingURL=three-
|
|
527
|
+
//# sourceMappingURL=three-F5D1OnE9.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"three-CsZ6Od1C.js","names":[],"sources":["../../src/three-events.ts","../../src/three.ts"],"sourcesContent":["import * as THREE from \"three\"\n\nexport interface ThreePointerEvent<N extends THREE.Object3D = THREE.Object3D> {\n\ttype: string\n\tnativeEvent: PointerEvent\n\ttarget: THREE.Object3D\n\tcurrentTarget: N\n\tintersection: THREE.Intersection\n\tray: THREE.Ray\n\tpointerId: number\n\tbutton: number\n\tbuttons: number\n\tclientX: number\n\tclientY: number\n\tstopPropagation(): void\n\tpreventDefault(): void\n\tsetPointerCapture(): void\n\treleasePointerCapture(): void\n\thasPointerCapture(): boolean\n}\nexport type ThreeEventHandler<N extends THREE.Object3D = THREE.Object3D> = (\n\tevent: ThreePointerEvent<N>,\n) => void\nexport interface ThreeEventAttributes<\n\tN extends THREE.Object3D = THREE.Object3D,\n> {\n\tonPointerDown?: ThreeEventHandler<N>\n\tonPointerUp?: ThreeEventHandler<N>\n\tonPointerMove?: ThreeEventHandler<N>\n\tonPointerEnter?: ThreeEventHandler<N>\n\tonPointerLeave?: ThreeEventHandler<N>\n\tonPointerOver?: ThreeEventHandler<N>\n\tonPointerOut?: ThreeEventHandler<N>\n\tonPointerCancel?: ThreeEventHandler<N>\n\tonClick?: ThreeEventHandler<N>\n}\ntype Hit = { node: THREE.Object3D; intersection: THREE.Intersection }\ntype Handler = ThreeEventHandler\nconst suspended = new WeakSet<THREE.Object3D>()\nexport function suspendThree(node: THREE.Object3D): () => void {\n\tsuspended.add(node)\n\tfor (const manager of managers) manager.remove(node)\n\treturn () => {\n\t\tsuspended.delete(node)\n\t}\n}\nconst listeners = new WeakMap<THREE.Object3D, Map<string, Set<Handler>>>()\nconst managers = new Set<{ remove(node: THREE.Object3D): void }>()\n\nexport function listenThree(\n\tnode: THREE.Object3D,\n\ttype: string,\n\thandler: Handler,\n): () => void {\n\tconst events = listeners.get(node) ?? new Map<string, Set<Handler>>()\n\tlisteners.set(node, events)\n\tconst handlers = events.get(type) ?? new Set<Handler>()\n\tevents.set(type, handlers)\n\thandlers.add(handler)\n\treturn () => {\n\t\thandlers.delete(handler)\n\t\tif (!handlers.size) events.delete(type)\n\t}\n}\nexport function forgetThree(node: THREE.Object3D): void {\n\tconst errors: unknown[] = []\n\tfor (const manager of managers) {\n\t\ttry {\n\t\t\tmanager.remove(node)\n\t\t} catch (error) {\n\t\t\terrors.push(error)\n\t\t}\n\t}\n\tlisteners.delete(node)\n\tif (errors.length) throw new AggregateError(errors)\n}\n\nexport interface ThreeEventManager {\n\tupdate(): void\n\t/** Release hover, press, and capture state for a removed subtree. */\n\tremove(node: THREE.Object3D): void\n\tdispose(): void\n}\n\n/** Attach raycast pointer routing to a canvas; usable with borrowed scene roots. */\nexport function createThreeEvents(\n\tcanvas: HTMLCanvasElement,\n\tscene: THREE.Object3D,\n\tcamera: () => THREE.Camera,\n\tonError: (error: unknown) => void = (error) => {\n\t\tthrow error\n\t},\n): ThreeEventManager {\n\tconst raycaster = new THREE.Raycaster()\n\tconst pointer = new THREE.Vector2()\n\tconst hovering = new Map<number, Hit>()\n\tconst pressed = new Map<number, Hit>()\n\tconst captures = new Map<number, Hit>()\n\tconst last = new Map<number, PointerEvent>()\n\tlet dead = false\n\tconst path = (node: THREE.Object3D) => {\n\t\tconst nodes: THREE.Object3D[] = []\n\t\tfor (let at: THREE.Object3D | null = node; at; at = at.parent) {\n\t\t\tnodes.push(at)\n\t\t\tif (at === scene) return nodes\n\t\t}\n\t\treturn []\n\t}\n\tconst contains = (node: THREE.Object3D, child: THREE.Object3D) => {\n\t\tfor (let at: THREE.Object3D | null = child; at; at = at.parent)\n\t\t\tif (at === node) return true\n\t\treturn false\n\t}\n\tconst eligible = (intersection: THREE.Intersection) => {\n\t\tconst nodes = path(intersection.object)\n\t\tif (\n\t\t\t!nodes.length ||\n\t\t\tnodes.some((node) => !node.visible || suspended.has(node))\n\t\t)\n\t\t\treturn false\n\t\tconst material = (intersection.object as THREE.Mesh).material\n\t\treturn (\n\t\t\t!material ||\n\t\t\t(Array.isArray(material)\n\t\t\t\t? material[intersection.face?.materialIndex ?? 0]?.visible !== false\n\t\t\t\t: material.visible)\n\t\t)\n\t}\n\tconst pick = (event: PointerEvent): Hit | undefined => {\n\t\tconst bounds = canvas.getBoundingClientRect()\n\t\tif (!bounds.width || !bounds.height) return undefined\n\t\tconst active = camera()\n\t\tscene.updateWorldMatrix(true, true)\n\t\tactive.updateWorldMatrix(true, false)\n\t\tpointer.set(\n\t\t\t((event.clientX - bounds.left) / bounds.width) * 2 - 1,\n\t\t\t1 - ((event.clientY - bounds.top) / bounds.height) * 2,\n\t\t)\n\t\traycaster.layers.mask = active.layers.mask\n\t\traycaster.setFromCamera(pointer, active)\n\t\tif (\n\t\t\tevent.clientX < bounds.left ||\n\t\t\tevent.clientX > bounds.right ||\n\t\t\tevent.clientY < bounds.top ||\n\t\t\tevent.clientY > bounds.bottom\n\t\t)\n\t\t\treturn undefined\n\t\tconst intersection = raycaster.intersectObject(scene, true).find(eligible)\n\t\treturn intersection ? { node: intersection.object, intersection } : undefined\n\t}\n\tconst nativeCapture = (id: number) => {\n\t\tif (canvas.hasPointerCapture?.(id)) canvas.releasePointerCapture(id)\n\t}\n\tconst dispatch = (\n\t\ttype: string,\n\t\thit: Hit,\n\t\tnativeEvent: PointerEvent,\n\t\tnodes = path(hit.node),\n\t) => {\n\t\tlet stopped = false\n\t\tfor (const node of nodes) {\n\t\t\tif (dead) break\n\t\t\tconst event: ThreePointerEvent = {\n\t\t\t\ttype,\n\t\t\t\tnativeEvent,\n\t\t\t\ttarget: hit.node,\n\t\t\t\tcurrentTarget: node,\n\t\t\t\tintersection: hit.intersection,\n\t\t\t\tray: raycaster.ray.clone(),\n\t\t\t\tpointerId: nativeEvent.pointerId,\n\t\t\t\tbutton: nativeEvent.button,\n\t\t\t\tbuttons: nativeEvent.buttons,\n\t\t\t\tclientX: nativeEvent.clientX,\n\t\t\t\tclientY: nativeEvent.clientY,\n\t\t\t\tstopPropagation() {\n\t\t\t\t\tstopped = true\n\t\t\t\t},\n\t\t\t\tpreventDefault() {\n\t\t\t\t\tnativeEvent.preventDefault()\n\t\t\t\t},\n\t\t\t\tsetPointerCapture() {\n\t\t\t\t\tcanvas.setPointerCapture(nativeEvent.pointerId)\n\t\t\t\t\tcaptures.set(nativeEvent.pointerId, {\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tintersection: hit.intersection,\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\treleasePointerCapture() {\n\t\t\t\t\tif (captures.get(nativeEvent.pointerId)?.node === node) {\n\t\t\t\t\t\tcaptures.delete(nativeEvent.pointerId)\n\t\t\t\t\t\tnativeCapture(nativeEvent.pointerId)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\thasPointerCapture() {\n\t\t\t\t\treturn captures.get(nativeEvent.pointerId)?.node === node\n\t\t\t\t},\n\t\t\t}\n\t\t\tfor (const handler of [...(listeners.get(node)?.get(type) ?? [])])\n\t\t\t\tif (!dead && listeners.get(node)?.get(type)?.has(handler)) handler(event)\n\t\t\tif (stopped) break\n\t\t}\n\t}\n\tconst hover = (event: PointerEvent, next?: Hit) => {\n\t\tconst previous = hovering.get(event.pointerId)\n\t\tif (previous?.node === next?.node) {\n\t\t\tif (next) hovering.set(event.pointerId, next)\n\t\t\treturn\n\t\t}\n\t\tconst oldPath = previous ? path(previous.node) : []\n\t\tconst newPath = next ? path(next.node) : []\n\t\t// Publish state first so handlers may remove nodes or dispose this manager safely.\n\t\tif (next) hovering.set(event.pointerId, next)\n\t\telse hovering.delete(event.pointerId)\n\t\tif (previous) {\n\t\t\tdispatch(`pointerout`, previous, event)\n\t\t\tfor (const node of oldPath)\n\t\t\t\tif (!newPath.includes(node))\n\t\t\t\t\tdispatch(`pointerleave`, previous, event, [node])\n\t\t}\n\t\tif (next && path(next.node).length) {\n\t\t\tdispatch(`pointerover`, next, event)\n\t\t\tfor (const node of newPath.reverse())\n\t\t\t\tif (!oldPath.includes(node))\n\t\t\t\t\tdispatch(`pointerenter`, next, event, [node])\n\t\t}\n\t}\n\tconst cancel = (event: PointerEvent) => {\n\t\tconst hit = captures.get(event.pointerId) ?? pressed.get(event.pointerId)\n\t\tcaptures.delete(event.pointerId)\n\t\tpressed.delete(event.pointerId)\n\t\ttry {\n\t\t\tif (hit) dispatch(`pointercancel`, hit, event)\n\t\t} finally {\n\t\t\tnativeCapture(event.pointerId)\n\t\t}\n\t}\n\tconst handle = (event: PointerEvent) => {\n\t\ttry {\n\t\t\tif (event.type === `lostpointercapture`) {\n\t\t\t\tcancel(event)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (event.type === `pointercancel`) {\n\t\t\t\tcancel(event)\n\t\t\t\thover(event)\n\t\t\t\tlast.delete(event.pointerId)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (event.type === `pointerleave`) {\n\t\t\t\tlast.set(event.pointerId, event)\n\t\t\t\thover(event)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlast.set(event.pointerId, event)\n\t\t\tconst hit = pick(event)\n\t\t\thover(event, hit)\n\t\t\tif (dead) return\n\t\t\tconst capture = captures.get(event.pointerId)\n\t\t\tif (capture && hit && contains(capture.node, hit.node))\n\t\t\t\tcapture.intersection = hit.intersection\n\t\t\tconst delivery = capture ?? hit\n\t\t\tif (event.type === `pointerdown`) {\n\t\t\t\tif (hit) {\n\t\t\t\t\tpressed.set(event.pointerId, hit)\n\t\t\t\t\tcanvas.setPointerCapture?.(event.pointerId)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (event.type === `pointerup`) {\n\t\t\t\tconst down = pressed.get(event.pointerId)\n\t\t\t\tpressed.delete(event.pointerId)\n\t\t\t\ttry {\n\t\t\t\t\t// Capture may belong to an ancestor of the original hit.\n\t\t\t\t\tif (down && !capture && down.node !== hit?.node)\n\t\t\t\t\t\tdispatch(`pointercancel`, down, event)\n\t\t\t\t\tif (delivery) dispatch(`pointerup`, delivery, event)\n\t\t\t\t\tif (down && down.node === hit?.node && event.button === 0)\n\t\t\t\t\t\tdispatch(`click`, hit, event)\n\t\t\t\t} finally {\n\t\t\t\t\tcaptures.delete(event.pointerId)\n\t\t\t\t\tnativeCapture(event.pointerId)\n\t\t\t\t\tif (event.pointerType === `touch`) {\n\t\t\t\t\t\thover(event)\n\t\t\t\t\t\tlast.delete(event.pointerId)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (delivery) dispatch(event.type, delivery, event)\n\t\t} catch (error) {\n\t\t\tonError(error)\n\t\t}\n\t}\n\tconst events = [\n\t\t`pointerdown`,\n\t\t`pointerup`,\n\t\t`pointermove`,\n\t\t`pointerleave`,\n\t\t`pointercancel`,\n\t\t`lostpointercapture`,\n\t] as const\n\tfor (const type of events) canvas.addEventListener(type, handle)\n\tconst manager = {\n\t\t/** Re-pick stationary pointers after camera, geometry, or transforms change. */\n\t\tupdate() {\n\t\t\tif (dead) return\n\t\t\ttry {\n\t\t\t\tfor (const event of last.values())\n\t\t\t\t\tif (event.type !== `pointerleave`) hover(event, pick(event))\n\t\t\t} catch (error) {\n\t\t\t\tonError(error)\n\t\t\t}\n\t\t},\n\t\tremove(node: THREE.Object3D) {\n\t\t\tconst errors: unknown[] = []\n\t\t\tfor (const [id, hit] of hovering)\n\t\t\t\tif (contains(node, hit.node)) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\thover(last.get(id)!)\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\terrors.push(error)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tfor (const [id, hit] of [...pressed, ...captures])\n\t\t\t\tif (contains(node, hit.node)) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tcancel(last.get(id)!)\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\terrors.push(error)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif (errors.length) throw new AggregateError(errors)\n\t\t},\n\t\tdispose() {\n\t\t\tif (dead) return\n\t\t\tdead = true\n\t\t\tfor (const type of events) canvas.removeEventListener(type, handle)\n\t\t\tfor (const id of new Set([...pressed.keys(), ...captures.keys()]))\n\t\t\t\tnativeCapture(id)\n\t\t\thovering.clear()\n\t\t\tpressed.clear()\n\t\t\tcaptures.clear()\n\t\t\tlast.clear()\n\t\t\tmanagers.delete(manager)\n\t\t},\n\t}\n\tmanagers.add(manager)\n\treturn manager\n}\n","import { isPresent, owner, reportScopeError, within } from \"./core.ts\"\nimport type { ThreeEventAttributes, ThreeEventHandler } from \"./three-events.ts\"\nimport {\n\tcreateThreeEvents,\n\tforgetThree,\n\tlistenThree,\n\tsuspendThree,\n} from \"./three-events.ts\"\n\nexport type {\n\tThreeEventAttributes,\n\tThreeEventHandler,\n\tThreeEventManager,\n\tThreePointerEvent,\n} from \"./three-events.ts\"\nexport { createThreeEvents } from \"./three-events.ts\"\nimport * as THREE from \"three\"\n\nimport type { Children, SpaElement } from \"./index.ts\"\nimport { onCleanup, onMount } from \"./index.ts\"\nimport type { CapabilityAttributes } from \"./jsx-runtime.ts\"\nimport { jsx } from \"./jsx-runtime.ts\"\nimport {\n\tbindScene,\n\tcreateSceneRenderer,\n\tonSceneFrame,\n\tsceneComponent,\n} from \"./renderer.ts\"\n\ntype Resource = THREE.Object3D | THREE.BufferGeometry | THREE.Material\ntype Vector3 = readonly [number, number, number]\nexport interface ObjectProps<N extends THREE.Object3D = THREE.Object3D>\n\textends CapabilityAttributes<`three`>, ThreeEventAttributes<N> {\n\tchildren?: Children\n\tposition?: Vector3\n\trotation?: Vector3\n\tscale?: Vector3 | number\n\tvisible?: boolean\n\tname?: string\n\tref?: (object: N | null) => void\n}\nconst constructors = {\n\tGroup: THREE.Group,\n\tMesh: THREE.Mesh,\n\tLineSegments: THREE.LineSegments,\n\tBufferGeometry: THREE.BufferGeometry,\n\tLineBasicMaterial: THREE.LineBasicMaterial,\n\tPerspectiveCamera: THREE.PerspectiveCamera,\n\tAmbientLight: THREE.AmbientLight,\n\tPointLight: THREE.PointLight,\n\tDirectionalLight: THREE.DirectionalLight,\n\tBoxGeometry: THREE.BoxGeometry,\n\tSphereGeometry: THREE.SphereGeometry,\n\tPlaneGeometry: THREE.PlaneGeometry,\n\tMeshStandardMaterial: THREE.MeshStandardMaterial,\n\tMeshBasicMaterial: THREE.MeshBasicMaterial,\n\tMeshNormalMaterial: THREE.MeshNormalMaterial,\n}\nconst drawableDefaults = new WeakMap<\n\tTHREE.Mesh | THREE.LineSegments,\n\t{\n\t\tgeometry: THREE.BufferGeometry\n\t\tmaterial: THREE.Material | THREE.Material[]\n\t\townsGeometry: boolean\n\t\townsMaterial: boolean\n\t}\n>()\nconst borrowedDrawableDefaults = new WeakMap<\n\tTHREE.Mesh | THREE.LineSegments,\n\t{\n\t\tgeometry: THREE.BufferGeometry\n\t\tmaterial: THREE.Material | THREE.Material[]\n\t}\n>()\nconst constructorArgs = new WeakMap<Resource, unknown[]>()\nconst eventHandlers = new WeakMap<Resource, Map<string, () => void>>()\nconst defaults = new WeakMap<Resource, Map<string, any>>()\nfunction writeProperty(node: Resource, key: string, value: any): void {\n\tconst target = node as any\n\tif (!(key in target)) throw new Error(`spa/three: unknown property ${key}`)\n\tconst current = target[key]\n\tif (current?.isColor) current.set(value)\n\telse if (Array.isArray(value) && typeof current?.set === `function`)\n\t\tcurrent.set(...value)\n\telse if (key === `scale` && typeof value === `number`) current.setScalar(value)\n\telse if (current?.copy && value?.constructor === current.constructor)\n\t\tcurrent.copy(value)\n\telse target[key] = value\n\tif (node instanceof THREE.PerspectiveCamera) node.updateProjectionMatrix()\n}\nconst renderer = createSceneRenderer<Resource>({\n\ttarget(node) {\n\t\treturn {\n\t\t\tkind: `three`,\n\t\t\tnode,\n\t\t\t...(node instanceof THREE.Object3D\n\t\t\t\t? {\n\t\t\t\t\t\tsuspend: () => suspendThree(node),\n\t\t\t\t\t\tlisten: (type: string, listener: () => void) =>\n\t\t\t\t\t\t\tlistenThree(node, type, listener),\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t\tread(key) {\n\t\t\t\tconst value = (node as any)[key]\n\t\t\t\treturn value?.isColor\n\t\t\t\t\t? value.getStyle()\n\t\t\t\t\t: value?.isVector3 || value?.isEuler\n\t\t\t\t\t\t? [value.x, value.y, value.z]\n\t\t\t\t\t\t: value\n\t\t\t},\n\t\t\twrite(key, value) {\n\t\t\t\twriteProperty(node, key, value)\n\t\t\t},\n\t\t}\n\t},\n\tcreate(type, props) {\n\t\tconst Constructor = constructors[type as keyof typeof constructors]\n\t\tif (!Constructor) throw new Error(`spa/three: unknown node ${type}`)\n\t\tconst node = new (Constructor as any)(...(props[`args`] ?? [])) as Resource\n\t\t// Drawables' implicit resources are replaced by owned JSX resources below.\n\t\tif (node instanceof THREE.Mesh || node instanceof THREE.LineSegments)\n\t\t\tdrawableDefaults.set(node, {\n\t\t\t\tgeometry: node.geometry,\n\t\t\t\tmaterial: node.material,\n\t\t\t\townsGeometry: props[`args`]?.[0] === undefined,\n\t\t\t\townsMaterial: props[`args`]?.[1] === undefined,\n\t\t\t})\n\t\tconstructorArgs.set(node, [...(props[`args`] ?? [])])\n\t\tdefaults.set(node, new Map())\n\t\teventHandlers.set(node, new Map())\n\t\treturn node\n\t},\n\tupdate(node, props, previous) {\n\t\tif (!equalArgs(constructorArgs.get(node)!, props[`args`]))\n\t\t\tthrow new Error(\n\t\t\t\t`spa/three: change the component key to replace constructor args`,\n\t\t\t)\n\t\tconst target = node as any\n\t\tconst saved = defaults.get(node)!\n\t\tfor (const key of new Set([\n\t\t\t...Object.keys(previous),\n\t\t\t...Object.keys(props),\n\t\t])) {\n\t\t\tif (\n\t\t\t\t/^(key|children|ref|args)$/.test(key) ||\n\t\t\t\tObject.is(props[key], previous[key])\n\t\t\t)\n\t\t\t\tcontinue\n\t\t\tif (key.startsWith(`on`)) {\n\t\t\t\tif (\n\t\t\t\t\t!(node instanceof THREE.Object3D) ||\n\t\t\t\t\t!/^on(Pointer(Down|Up|Move|Enter|Leave|Over|Out|Cancel)|Click)$/.test(\n\t\t\t\t\t\tkey,\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t\tthrow new Error(`spa/three: unknown event ${key}`)\n\t\t\t\tconst handlers = eventHandlers.get(node)!\n\t\t\t\thandlers.get(key)?.()\n\t\t\t\thandlers.delete(key)\n\t\t\t\tconst handler = props[key] as ThreeEventHandler | undefined\n\t\t\t\tif (handler) {\n\t\t\t\t\tconst scope = owner!\n\t\t\t\t\thandlers.set(\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tlistenThree(node, key.slice(2).toLowerCase(), (event) => {\n\t\t\t\t\t\t\twithin(scope, () => {\n\t\t\t\t\t\t\t\thandler(event)\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (!(key in target)) throw new Error(`spa/three: unknown property ${key}`)\n\t\t\tconst current = target[key]\n\t\t\tif (!saved.has(key))\n\t\t\t\tsaved.set(key, current?.clone ? current.clone() : current)\n\t\t\tconst value = props[key] === undefined ? saved.get(key) : props[key]\n\t\t\twriteProperty(node, key, value)\n\t\t}\n\t\tif (node instanceof THREE.PerspectiveCamera) node.updateProjectionMatrix()\n\t},\n\tchildren(parent, children, activeChildren) {\n\t\tif (!(parent instanceof THREE.Object3D)) {\n\t\t\tif (children.length)\n\t\t\t\tthrow new Error(`spa/three: resources cannot contain children`)\n\t\t\treturn\n\t\t}\n\t\tconst objects = children.filter(\n\t\t\t(child): child is THREE.Object3D => child instanceof THREE.Object3D,\n\t\t)\n\t\tif (\n\t\t\tparent.children.length !== objects.length ||\n\t\t\tobjects.some((child, index) => child !== parent.children[index])\n\t\t) {\n\t\t\tconst wanted = new Set(objects)\n\t\t\tfor (const child of [...parent.children])\n\t\t\t\tif (!wanted.has(child)) parent.remove(child)\n\t\t\tfor (const child of objects) if (child.parent !== parent) parent.add(child)\n\t\t\tparent.children.splice(0, parent.children.length, ...objects)\n\t\t}\n\t\tconst resources = children.filter(\n\t\t\t(child) => !(child instanceof THREE.Object3D),\n\t\t)\n\t\tif (\n\t\t\tresources.length &&\n\t\t\t!(parent instanceof THREE.Mesh || parent instanceof THREE.LineSegments)\n\t\t)\n\t\t\tthrow new Error(\n\t\t\t\t`spa/three: geometry and material require a Mesh or LineSegments parent`,\n\t\t\t)\n\t\tif (parent instanceof THREE.Mesh || parent instanceof THREE.LineSegments) {\n\t\t\tconst geometries = resources.filter(\n\t\t\t\t(child) => child instanceof THREE.BufferGeometry,\n\t\t\t)\n\t\t\tconst materials = resources.filter(\n\t\t\t\t(child) => child instanceof THREE.Material,\n\t\t\t)\n\t\t\tconst activeGeometries = activeChildren.filter(\n\t\t\t\t(child) => child instanceof THREE.BufferGeometry,\n\t\t\t)\n\t\t\tconst activeMaterials = activeChildren.filter(\n\t\t\t\t(child) => child instanceof THREE.Material,\n\t\t\t)\n\t\t\tif (activeGeometries.length > 1 || activeMaterials.length > 1)\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`spa/three: each ${parent instanceof THREE.Mesh ? `Mesh` : `LineSegments`} accepts one geometry and one material`,\n\t\t\t\t)\n\t\t\tconst owned = drawableDefaults.get(parent)\n\t\t\tlet baseline = owned ?? borrowedDrawableDefaults.get(parent)\n\t\t\tif (!baseline) {\n\t\t\t\tbaseline = { geometry: parent.geometry, material: parent.material }\n\t\t\t\tborrowedDrawableDefaults.set(parent, baseline)\n\t\t\t}\n\t\t\t// Retention owns outgoing resources without occupying incoming attachment slots.\n\t\t\tparent.geometry =\n\t\t\t\tactiveGeometries[0] ??\n\t\t\t\tgeometries.find((geometry) => geometry === parent.geometry) ??\n\t\t\t\tgeometries.at(-1) ??\n\t\t\t\tbaseline.geometry\n\t\t\tparent.material =\n\t\t\t\tactiveMaterials[0] ??\n\t\t\t\tmaterials.find((material) => material === parent.material) ??\n\t\t\t\tmaterials.at(-1) ??\n\t\t\t\tbaseline.material\n\t\t\tif (!owned && children.length === 0)\n\t\t\t\tborrowedDrawableDefaults.delete(parent)\n\t\t}\n\t},\n\tdestroy(node) {\n\t\teventHandlers.get(node)!.clear()\n\t\tif (node instanceof THREE.Object3D) {\n\t\t\ttry {\n\t\t\t\tforgetThree(node)\n\t\t\t} finally {\n\t\t\t\tnode.removeFromParent()\n\t\t\t\tif (node instanceof THREE.Mesh || node instanceof THREE.LineSegments) {\n\t\t\t\t\tconst owned = drawableDefaults.get(node)!\n\t\t\t\t\tif (owned.ownsGeometry) owned.geometry.dispose()\n\t\t\t\t\tif (owned.ownsMaterial) (owned.material as THREE.Material).dispose()\n\t\t\t\t}\n\t\t\t}\n\t\t} else node.dispose()\n\t},\n})\nfunction equalArgs(a: unknown[], b: unknown[] = []): boolean {\n\treturn (\n\t\ta.length === b.length &&\n\t\ta.every(\n\t\t\t(value, index) =>\n\t\t\t\tObject.is(value, b[index]) ||\n\t\t\t\t(Array.isArray(value) &&\n\t\t\t\t\tArray.isArray(b[index]) &&\n\t\t\t\t\tequalArgs(value, b[index])),\n\t\t)\n\t)\n}\n\nexport interface CanvasState {\n\tscene: THREE.Scene\n\tcamera: THREE.Camera\n\trenderer: THREE.WebGLRenderer\n}\nexport interface CanvasResizeState extends CanvasState {\n\twidth: number\n\theight: number\n\tdpr: number\n}\nexport interface CanvasProps {\n\tchildren?: Children\n\twidth?: number\n\theight?: number\n\tcamera?: THREE.Camera\n\t/** Constructor-time options. Canvas always supplies its own DOM canvas. */\n\trendererOptions?: Omit<THREE.WebGLRendererParameters, `canvas`>\n\t/** The returned renderer belongs exclusively to Canvas and is disposed with it. */\n\tcreateRenderer?: (\n\t\toptions: THREE.WebGLRendererParameters,\n\t) => THREE.WebGLRenderer\n\t/** Handle renderer creation failure locally, for example by offering an accessible fallback. */\n\tonError?: (error: unknown) => void\n\t/** A fixed ratio, or a device-pixel-ratio clamp. Defaults to 1. */\n\tdpr?: number | readonly [min: number, max: number]\n\t/** Runs after sizing and scene mounting, before the first draw. May return cleanup. */\n\tonCreated?: (state: CanvasState) => void | (() => void)\n\t/** Supplied cameras keep their projection; update it explicitly here if desired. */\n\tonResize?: (state: CanvasResizeState) => void\n\t/** Skip an idle GPU draw. Frame callbacks and pointer updates still run. */\n\trenderWhen?: () => boolean\n\tonFrame?: (state: CanvasState & { delta: number; time: number }) => void\n}\n/** Browser-only scene boundary. The camera prop is borrowed and never disposed. */\nexport function Canvas(props: CanvasProps): SpaElement {\n\tlet canvas: HTMLCanvasElement | null = null\n\tonMount(() => {\n\t\tconst parameters: THREE.WebGLRendererParameters = {\n\t\t\tantialias: true,\n\t\t\t...props.rendererOptions,\n\t\t\tcanvas: canvas!,\n\t\t}\n\t\tlet webgl: THREE.WebGLRenderer\n\t\ttry {\n\t\t\twebgl = props.createRenderer\n\t\t\t\t? props.createRenderer(parameters)\n\t\t\t\t: new THREE.WebGLRenderer(parameters)\n\t\t} catch (error) {\n\t\t\tif (!props.onError) throw error\n\t\t\tprops.onError(error)\n\t\t\treturn\n\t\t}\n\t\tonCleanup(() => {\n\t\t\twebgl.dispose()\n\t\t})\n\t\tif (webgl.domElement !== canvas)\n\t\t\tthrow new Error(`spa/three: renderer must use the supplied Canvas element`)\n\t\tconst scene = new THREE.Scene()\n\t\tconst camera = new THREE.PerspectiveCamera(50, 1, 0.1, 1000)\n\t\tcamera.position.z = 5\n\t\tconst view = canvas.ownerDocument.defaultView!\n\t\tconst size = () => ({\n\t\t\twidth: props.width ?? 800,\n\t\t\theight: props.height ?? 600,\n\t\t\tdpr: props.dpr ?? 1,\n\t\t\tactive: props.camera ?? camera,\n\t\t})\n\t\tconst resize = ({ width, height, dpr, active }: ReturnType<typeof size>) => {\n\t\t\tconst range = typeof dpr === `number` ? [dpr, dpr] : dpr\n\t\t\tif (\n\t\t\t\t![width, height, ...range].every(\n\t\t\t\t\t(value) => Number.isFinite(value) && value > 0,\n\t\t\t\t) ||\n\t\t\t\trange[0] > range[1]\n\t\t\t)\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`spa/three: dimensions and DPR must be positive with an ordered DPR range`,\n\t\t\t\t)\n\t\t\tconst ratio = Math.max(\n\t\t\t\trange[0],\n\t\t\t\tMath.min(range[1], view.devicePixelRatio || 1),\n\t\t\t)\n\t\t\twebgl.setPixelRatio(ratio)\n\t\t\twebgl.setSize(width, height)\n\t\t\tcamera.aspect = width / height\n\t\t\tcamera.updateProjectionMatrix()\n\t\t\tprops.onResize?.({\n\t\t\t\tscene,\n\t\t\t\tcamera: active,\n\t\t\t\trenderer: webgl,\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\tdpr: ratio,\n\t\t\t})\n\t\t}\n\t\tbindScene(size, resize)\n\t\tconst scope = owner!\n\t\tconst resized = () => {\n\t\t\ttry {\n\t\t\t\tresize(size())\n\t\t\t} catch (error) {\n\t\t\t\treportScopeError(scope, error)\n\t\t\t}\n\t\t}\n\t\tview.addEventListener(`resize`, resized)\n\t\tonCleanup(() => {\n\t\t\tview.removeEventListener(`resize`, resized)\n\t\t})\n\t\trenderer.mount(() => props.children, scene)\n\t\tconst events = createThreeEvents(\n\t\t\tcanvas,\n\t\t\tscene,\n\t\t\t() => props.camera ?? camera,\n\t\t\t(error) => {\n\t\t\t\treportScopeError(scope, error)\n\t\t\t},\n\t\t)\n\t\tonCleanup(() => {\n\t\t\tevents.dispose()\n\t\t})\n\t\t// Scene mounting queues child refs and mount hooks; setup must follow them.\n\t\tonMount(() => {\n\t\t\tconst cleanup = props.onCreated?.({\n\t\t\t\tscene,\n\t\t\t\tcamera: props.camera ?? camera,\n\t\t\t\trenderer: webgl,\n\t\t\t})\n\t\t\tif (cleanup) onCleanup(cleanup)\n\t\t\tlet last: number | undefined\n\t\t\tonSceneFrame((time) => {\n\t\t\t\tconst active = props.camera ?? camera\n\t\t\t\tconst delta = last === undefined ? 0 : (time - last) / 1000\n\t\t\t\tlast = time\n\t\t\t\tconst present = isPresent(scope)\n\t\t\t\tconst draw = !present || (props.renderWhen?.() ?? true)\n\t\t\t\tif (present)\n\t\t\t\t\tprops.onFrame?.({\n\t\t\t\t\t\tscene,\n\t\t\t\t\t\tcamera: active,\n\t\t\t\t\t\trenderer: webgl,\n\t\t\t\t\t\tdelta,\n\t\t\t\t\t\ttime: time / 1000,\n\t\t\t\t\t})\n\t\t\t\tevents.update()\n\t\t\t\tif (draw) webgl.render(scene, active)\n\t\t\t}, true)\n\t\t})\n\t})\n\treturn jsx(`canvas`, {\n\t\tref: (element: HTMLCanvasElement | null) => {\n\t\t\tcanvas = element\n\t\t},\n\t})\n}\nexport const Group = sceneComponent<ObjectProps>(`Group`)\nexport const Mesh = sceneComponent<\n\tObjectProps<THREE.Mesh> & {\n\t\targs?: ConstructorParameters<typeof THREE.Mesh>\n\t}\n>(`Mesh`)\nexport const PerspectiveCamera = sceneComponent<\n\tObjectProps<THREE.PerspectiveCamera> & {\n\t\targs?: ConstructorParameters<typeof THREE.PerspectiveCamera>\n\t\tfov?: number\n\t\taspect?: number\n\t\tnear?: number\n\t\tfar?: number\n\t}\n>(`PerspectiveCamera`)\nexport const AmbientLight = sceneComponent<\n\tObjectProps<THREE.Light> & {\n\t\tcolor?: THREE.ColorRepresentation\n\t\tintensity?: number\n\t}\n>(`AmbientLight`)\nexport const DirectionalLight = sceneComponent<\n\tObjectProps<THREE.Light> & {\n\t\tcolor?: THREE.ColorRepresentation\n\t\tintensity?: number\n\t}\n>(`DirectionalLight`)\nexport const PointLight = sceneComponent<\n\tObjectProps<THREE.PointLight> & {\n\t\tcolor?: THREE.ColorRepresentation\n\t\tintensity?: number\n\t\tdistance?: number\n\t\tdecay?: number\n\t}\n>(`PointLight`)\nexport const BoxGeometry = sceneComponent<{\n\targs?: ConstructorParameters<typeof THREE.BoxGeometry>\n\tref?: (node: THREE.BoxGeometry | null) => void\n}>(`BoxGeometry`)\nexport const SphereGeometry = sceneComponent<{\n\targs?: ConstructorParameters<typeof THREE.SphereGeometry>\n\tref?: (node: THREE.SphereGeometry | null) => void\n}>(`SphereGeometry`)\nexport const PlaneGeometry = sceneComponent<{\n\targs?: ConstructorParameters<typeof THREE.PlaneGeometry>\n\tref?: (node: THREE.PlaneGeometry | null) => void\n}>(`PlaneGeometry`)\nexport const MeshStandardMaterial = sceneComponent<\n\tTHREE.MeshStandardMaterialParameters &\n\t\tCapabilityAttributes<`three`> & {\n\t\t\tref?: (node: THREE.MeshStandardMaterial | null) => void\n\t\t}\n>(`MeshStandardMaterial`)\nexport const MeshBasicMaterial = sceneComponent<\n\tTHREE.MeshBasicMaterialParameters &\n\t\tCapabilityAttributes<`three`> & {\n\t\t\tref?: (node: THREE.MeshBasicMaterial | null) => void\n\t\t}\n>(`MeshBasicMaterial`)\nexport const MeshNormalMaterial = sceneComponent<\n\tTHREE.MeshNormalMaterialParameters &\n\t\tCapabilityAttributes<`three`> & {\n\t\t\tref?: (node: THREE.MeshNormalMaterial | null) => void\n\t\t}\n>(`MeshNormalMaterial`)\nexport { renderer as threeRenderer }\n\n/** Batched line geometry, with the same attachment and ownership rules as Mesh. */\nexport const LineSegments = sceneComponent<\n\tObjectProps<THREE.LineSegments> & {\n\t\targs?: ConstructorParameters<typeof THREE.LineSegments>\n\t\tfrustumCulled?: boolean\n\t}\n>(`LineSegments`)\nexport const BufferGeometry = sceneComponent<{\n\tref?: (node: THREE.BufferGeometry | null) => void\n}>(`BufferGeometry`)\nexport const LineBasicMaterial = sceneComponent<\n\tTHREE.LineBasicMaterialParameters & {\n\t\tref?: (node: THREE.LineBasicMaterial | null) => void\n\t}\n>(`LineBasicMaterial`)\n"],"mappings":";;;;;AAsCA,MAAM,4BAAY,IAAI,QAAwB;AAC9C,SAAgB,aAAa,MAAkC;CAC9D,UAAU,IAAI,IAAI;CAClB,KAAK,MAAM,WAAW,UAAU,QAAQ,OAAO,IAAI;CACnD,aAAa;EACZ,UAAU,OAAO,IAAI;CACtB;AACD;AACA,MAAM,4BAAY,IAAI,QAAmD;AACzE,MAAM,2BAAW,IAAI,IAA4C;AAEjE,SAAgB,YACf,MACA,MACA,SACa;CACb,MAAM,SAAS,UAAU,IAAI,IAAI,qBAAK,IAAI,IAA0B;CACpE,UAAU,IAAI,MAAM,MAAM;CAC1B,MAAM,WAAW,OAAO,IAAI,IAAI,qBAAK,IAAI,IAAa;CACtD,OAAO,IAAI,MAAM,QAAQ;CACzB,SAAS,IAAI,OAAO;CACpB,aAAa;EACZ,SAAS,OAAO,OAAO;EACvB,IAAI,CAAC,SAAS,MAAM,OAA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M,OAAO,CAAC,YAAY,MAAM,aAAa,KAAK;IAClD,IAAI,SACH,MAAM,UAAU;KACf;KACA,QAAQ;KACR,UAAU;KACV;KACA,MAAM,OAAO;IACd,CAAC;IACF,OAAO,OAAO;IACd,IAAI,MAAM,MAAM,OAAO,OAAO,MAAM;GACrC,GAAG,IAAI;EACR,CAAC;CACF,CAAC;CACD,OAAO,IAAI,UAAU,EACpB,MAAM,YAAsC;EAC3C,SAAS;CACV,EACD,CAAC;AACF;AACA,MAAa,QAAQ,eAA4B,OAAO;AACxD,MAAa,OAAO,eAIlB,MAAM;AACR,MAAa,oBAAoB,eAQ/B,mBAAmB;AACrB,MAAa,eAAe,eAK1B,cAAc;AAChB,MAAa,mBAAmB,eAK9B,kBAAkB;AACpB,MAAa,aAAa,eAOxB,YAAY;AACd,MAAa,cAAc,eAGxB,aAAa;AAChB,MAAa,iBAAiB,eAG3B,gBAAgB;AACnB,MAAa,gBAAgB,eAG1B,eAAe;AAClB,MAAa,uBAAuB,eAKlC,sBAAsB;AACxB,MAAa,oBAAoB,eAK/B,mBAAmB;AACrB,MAAa,qBAAqB,eAKhC,oBAAoB;;AAItB,MAAa,eAAe,eAK1B,cAAc;AAChB,MAAa,iBAAiB,eAE3B,gBAAgB;AACnB,MAAa,oBAAoB,eAI/B,mBAAmB"}
|
|
1
|
+
{"version":3,"file":"three-F5D1OnE9.js","names":[],"sources":["../../src/three-events.ts","../../src/three.ts"],"sourcesContent":["import * as THREE from \"three\"\n\nexport interface ThreePointerEvent<N extends THREE.Object3D = THREE.Object3D> {\n\ttype: string\n\tnativeEvent: PointerEvent\n\ttarget: THREE.Object3D\n\tcurrentTarget: N\n\tintersection: THREE.Intersection\n\tray: THREE.Ray\n\tpointerId: number\n\tbutton: number\n\tbuttons: number\n\tclientX: number\n\tclientY: number\n\tstopPropagation(): void\n\tpreventDefault(): void\n\tsetPointerCapture(): void\n\treleasePointerCapture(): void\n\thasPointerCapture(): boolean\n}\nexport type ThreeEventHandler<N extends THREE.Object3D = THREE.Object3D> = (\n\tevent: ThreePointerEvent<N>,\n) => void\nexport interface ThreeEventAttributes<\n\tN extends THREE.Object3D = THREE.Object3D,\n> {\n\tonPointerDown?: ThreeEventHandler<N>\n\tonPointerUp?: ThreeEventHandler<N>\n\tonPointerMove?: ThreeEventHandler<N>\n\tonPointerEnter?: ThreeEventHandler<N>\n\tonPointerLeave?: ThreeEventHandler<N>\n\tonPointerOver?: ThreeEventHandler<N>\n\tonPointerOut?: ThreeEventHandler<N>\n\tonPointerCancel?: ThreeEventHandler<N>\n\tonClick?: ThreeEventHandler<N>\n}\ntype Hit = { node: THREE.Object3D; intersection: THREE.Intersection }\ntype Handler = ThreeEventHandler\nconst suspended = new WeakSet<THREE.Object3D>()\nexport function suspendThree(node: THREE.Object3D): () => void {\n\tsuspended.add(node)\n\tfor (const manager of managers) manager.remove(node)\n\treturn () => {\n\t\tsuspended.delete(node)\n\t}\n}\nconst listeners = new WeakMap<THREE.Object3D, Map<string, Set<Handler>>>()\nconst managers = new Set<{ remove(node: THREE.Object3D): void }>()\n\nexport function listenThree(\n\tnode: THREE.Object3D,\n\ttype: string,\n\thandler: Handler,\n): () => void {\n\tconst events = listeners.get(node) ?? new Map<string, Set<Handler>>()\n\tlisteners.set(node, events)\n\tconst handlers = events.get(type) ?? new Set<Handler>()\n\tevents.set(type, handlers)\n\thandlers.add(handler)\n\treturn () => {\n\t\thandlers.delete(handler)\n\t\tif (!handlers.size) events.delete(type)\n\t}\n}\nexport function forgetThree(node: THREE.Object3D): void {\n\tconst errors: unknown[] = []\n\tfor (const manager of managers) {\n\t\ttry {\n\t\t\tmanager.remove(node)\n\t\t} catch (error) {\n\t\t\terrors.push(error)\n\t\t}\n\t}\n\tlisteners.delete(node)\n\tif (errors.length) throw new AggregateError(errors)\n}\n\nexport interface ThreeEventManager {\n\tupdate(): void\n\t/** Release hover, press, and capture state for a removed subtree. */\n\tremove(node: THREE.Object3D): void\n\tdispose(): void\n}\n\n/** Attach raycast pointer routing to a canvas; usable with borrowed scene roots. */\nexport function createThreeEvents(\n\tcanvas: HTMLCanvasElement,\n\tscene: THREE.Object3D,\n\tcamera: () => THREE.Camera,\n\tonError: (error: unknown) => void = (error) => {\n\t\tthrow error\n\t},\n): ThreeEventManager {\n\tconst raycaster = new THREE.Raycaster()\n\tconst pointer = new THREE.Vector2()\n\tconst hovering = new Map<number, Hit>()\n\tconst pressed = new Map<number, Hit>()\n\tconst captures = new Map<number, Hit>()\n\tconst last = new Map<number, PointerEvent>()\n\tlet dead = false\n\tconst path = (node: THREE.Object3D) => {\n\t\tconst nodes: THREE.Object3D[] = []\n\t\tfor (let at: THREE.Object3D | null = node; at; at = at.parent) {\n\t\t\tnodes.push(at)\n\t\t\tif (at === scene) return nodes\n\t\t}\n\t\treturn []\n\t}\n\tconst contains = (node: THREE.Object3D, child: THREE.Object3D) => {\n\t\tfor (let at: THREE.Object3D | null = child; at; at = at.parent)\n\t\t\tif (at === node) return true\n\t\treturn false\n\t}\n\tconst eligible = (intersection: THREE.Intersection) => {\n\t\tconst nodes = path(intersection.object)\n\t\tif (\n\t\t\t!nodes.length ||\n\t\t\tnodes.some((node) => !node.visible || suspended.has(node))\n\t\t)\n\t\t\treturn false\n\t\tconst material = (intersection.object as THREE.Mesh).material\n\t\treturn (\n\t\t\t!material ||\n\t\t\t(Array.isArray(material)\n\t\t\t\t? material[intersection.face?.materialIndex ?? 0]?.visible !== false\n\t\t\t\t: material.visible)\n\t\t)\n\t}\n\tconst pick = (event: PointerEvent): Hit | undefined => {\n\t\tconst bounds = canvas.getBoundingClientRect()\n\t\tif (!bounds.width || !bounds.height) return undefined\n\t\tconst active = camera()\n\t\tscene.updateWorldMatrix(true, true)\n\t\tactive.updateWorldMatrix(true, false)\n\t\tpointer.set(\n\t\t\t((event.clientX - bounds.left) / bounds.width) * 2 - 1,\n\t\t\t1 - ((event.clientY - bounds.top) / bounds.height) * 2,\n\t\t)\n\t\traycaster.layers.mask = active.layers.mask\n\t\traycaster.setFromCamera(pointer, active)\n\t\tif (\n\t\t\tevent.clientX < bounds.left ||\n\t\t\tevent.clientX > bounds.right ||\n\t\t\tevent.clientY < bounds.top ||\n\t\t\tevent.clientY > bounds.bottom\n\t\t)\n\t\t\treturn undefined\n\t\tconst intersection = raycaster.intersectObject(scene, true).find(eligible)\n\t\treturn intersection ? { node: intersection.object, intersection } : undefined\n\t}\n\tconst nativeCapture = (id: number) => {\n\t\tif (canvas.hasPointerCapture?.(id)) canvas.releasePointerCapture(id)\n\t}\n\tconst dispatch = (\n\t\ttype: string,\n\t\thit: Hit,\n\t\tnativeEvent: PointerEvent,\n\t\tnodes = path(hit.node),\n\t) => {\n\t\tlet stopped = false\n\t\tfor (const node of nodes) {\n\t\t\tif (dead) break\n\t\t\tconst event: ThreePointerEvent = {\n\t\t\t\ttype,\n\t\t\t\tnativeEvent,\n\t\t\t\ttarget: hit.node,\n\t\t\t\tcurrentTarget: node,\n\t\t\t\tintersection: hit.intersection,\n\t\t\t\tray: raycaster.ray.clone(),\n\t\t\t\tpointerId: nativeEvent.pointerId,\n\t\t\t\tbutton: nativeEvent.button,\n\t\t\t\tbuttons: nativeEvent.buttons,\n\t\t\t\tclientX: nativeEvent.clientX,\n\t\t\t\tclientY: nativeEvent.clientY,\n\t\t\t\tstopPropagation() {\n\t\t\t\t\tstopped = true\n\t\t\t\t},\n\t\t\t\tpreventDefault() {\n\t\t\t\t\tnativeEvent.preventDefault()\n\t\t\t\t},\n\t\t\t\tsetPointerCapture() {\n\t\t\t\t\tcanvas.setPointerCapture(nativeEvent.pointerId)\n\t\t\t\t\tcaptures.set(nativeEvent.pointerId, {\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tintersection: hit.intersection,\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\treleasePointerCapture() {\n\t\t\t\t\tif (captures.get(nativeEvent.pointerId)?.node === node) {\n\t\t\t\t\t\tcaptures.delete(nativeEvent.pointerId)\n\t\t\t\t\t\tnativeCapture(nativeEvent.pointerId)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\thasPointerCapture() {\n\t\t\t\t\treturn captures.get(nativeEvent.pointerId)?.node === node\n\t\t\t\t},\n\t\t\t}\n\t\t\tfor (const handler of [...(listeners.get(node)?.get(type) ?? [])])\n\t\t\t\tif (!dead && listeners.get(node)?.get(type)?.has(handler)) handler(event)\n\t\t\tif (stopped) break\n\t\t}\n\t}\n\tconst hover = (event: PointerEvent, next?: Hit) => {\n\t\tconst previous = hovering.get(event.pointerId)\n\t\tif (previous?.node === next?.node) {\n\t\t\tif (next) hovering.set(event.pointerId, next)\n\t\t\treturn\n\t\t}\n\t\tconst oldPath = previous ? path(previous.node) : []\n\t\tconst newPath = next ? path(next.node) : []\n\t\t// Publish state first so handlers may remove nodes or dispose this manager safely.\n\t\tif (next) hovering.set(event.pointerId, next)\n\t\telse hovering.delete(event.pointerId)\n\t\tif (previous) {\n\t\t\tdispatch(`pointerout`, previous, event)\n\t\t\tfor (const node of oldPath)\n\t\t\t\tif (!newPath.includes(node))\n\t\t\t\t\tdispatch(`pointerleave`, previous, event, [node])\n\t\t}\n\t\tif (next && path(next.node).length) {\n\t\t\tdispatch(`pointerover`, next, event)\n\t\t\tfor (const node of newPath.reverse())\n\t\t\t\tif (!oldPath.includes(node))\n\t\t\t\t\tdispatch(`pointerenter`, next, event, [node])\n\t\t}\n\t}\n\tconst cancel = (event: PointerEvent) => {\n\t\tconst hit = captures.get(event.pointerId) ?? pressed.get(event.pointerId)\n\t\tcaptures.delete(event.pointerId)\n\t\tpressed.delete(event.pointerId)\n\t\ttry {\n\t\t\tif (hit) dispatch(`pointercancel`, hit, event)\n\t\t} finally {\n\t\t\tnativeCapture(event.pointerId)\n\t\t}\n\t}\n\tconst handle = (event: PointerEvent) => {\n\t\ttry {\n\t\t\tif (event.type === `lostpointercapture`) {\n\t\t\t\tcancel(event)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (event.type === `pointercancel`) {\n\t\t\t\tcancel(event)\n\t\t\t\thover(event)\n\t\t\t\tlast.delete(event.pointerId)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (event.type === `pointerleave`) {\n\t\t\t\tlast.set(event.pointerId, event)\n\t\t\t\thover(event)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlast.set(event.pointerId, event)\n\t\t\tconst hit = pick(event)\n\t\t\thover(event, hit)\n\t\t\tif (dead) return\n\t\t\tconst capture = captures.get(event.pointerId)\n\t\t\tif (capture && hit && contains(capture.node, hit.node))\n\t\t\t\tcapture.intersection = hit.intersection\n\t\t\tconst delivery = capture ?? hit\n\t\t\tif (event.type === `pointerdown`) {\n\t\t\t\tif (hit) {\n\t\t\t\t\tpressed.set(event.pointerId, hit)\n\t\t\t\t\tcanvas.setPointerCapture?.(event.pointerId)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (event.type === `pointerup`) {\n\t\t\t\tconst down = pressed.get(event.pointerId)\n\t\t\t\tpressed.delete(event.pointerId)\n\t\t\t\ttry {\n\t\t\t\t\t// Capture may belong to an ancestor of the original hit.\n\t\t\t\t\tif (down && !capture && down.node !== hit?.node)\n\t\t\t\t\t\tdispatch(`pointercancel`, down, event)\n\t\t\t\t\tif (delivery) dispatch(`pointerup`, delivery, event)\n\t\t\t\t\tif (down && down.node === hit?.node && event.button === 0)\n\t\t\t\t\t\tdispatch(`click`, hit, event)\n\t\t\t\t} finally {\n\t\t\t\t\tcaptures.delete(event.pointerId)\n\t\t\t\t\tnativeCapture(event.pointerId)\n\t\t\t\t\tif (event.pointerType === `touch`) {\n\t\t\t\t\t\thover(event)\n\t\t\t\t\t\tlast.delete(event.pointerId)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (delivery) dispatch(event.type, delivery, event)\n\t\t} catch (error) {\n\t\t\tonError(error)\n\t\t}\n\t}\n\tconst events = [\n\t\t`pointerdown`,\n\t\t`pointerup`,\n\t\t`pointermove`,\n\t\t`pointerleave`,\n\t\t`pointercancel`,\n\t\t`lostpointercapture`,\n\t] as const\n\tfor (const type of events) canvas.addEventListener(type, handle)\n\tconst manager = {\n\t\t/** Re-pick stationary pointers after camera, geometry, or transforms change. */\n\t\tupdate() {\n\t\t\tif (dead) return\n\t\t\ttry {\n\t\t\t\tfor (const event of last.values())\n\t\t\t\t\tif (event.type !== `pointerleave`) hover(event, pick(event))\n\t\t\t} catch (error) {\n\t\t\t\tonError(error)\n\t\t\t}\n\t\t},\n\t\tremove(node: THREE.Object3D) {\n\t\t\tconst errors: unknown[] = []\n\t\t\tfor (const [id, hit] of hovering)\n\t\t\t\tif (contains(node, hit.node)) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\thover(last.get(id)!)\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\terrors.push(error)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tfor (const [id, hit] of [...pressed, ...captures])\n\t\t\t\tif (contains(node, hit.node)) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tcancel(last.get(id)!)\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\terrors.push(error)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif (errors.length) throw new AggregateError(errors)\n\t\t},\n\t\tdispose() {\n\t\t\tif (dead) return\n\t\t\tdead = true\n\t\t\tfor (const type of events) canvas.removeEventListener(type, handle)\n\t\t\tfor (const id of new Set([...pressed.keys(), ...captures.keys()]))\n\t\t\t\tnativeCapture(id)\n\t\t\thovering.clear()\n\t\t\tpressed.clear()\n\t\t\tcaptures.clear()\n\t\t\tlast.clear()\n\t\t\tmanagers.delete(manager)\n\t\t},\n\t}\n\tmanagers.add(manager)\n\treturn manager\n}\n","import { isPresent, owner, reportScopeError, within } from \"./core.ts\"\nimport type { ThreeEventAttributes, ThreeEventHandler } from \"./three-events.ts\"\nimport {\n\tcreateThreeEvents,\n\tforgetThree,\n\tlistenThree,\n\tsuspendThree,\n} from \"./three-events.ts\"\n\nexport type {\n\tThreeEventAttributes,\n\tThreeEventHandler,\n\tThreeEventManager,\n\tThreePointerEvent,\n} from \"./three-events.ts\"\nexport { createThreeEvents } from \"./three-events.ts\"\nimport * as THREE from \"three\"\n\nimport type { Children, SpaElement } from \"./index.ts\"\nimport { onCleanup, onMount } from \"./index.ts\"\nimport type { CapabilityAttributes } from \"./jsx-runtime.ts\"\nimport { jsx } from \"./jsx-runtime.ts\"\nimport {\n\tbindScene,\n\tcreateSceneRenderer,\n\tonSceneFrame,\n\tsceneComponent,\n} from \"./renderer.ts\"\n\ntype Resource = THREE.Object3D | THREE.BufferGeometry | THREE.Material\ntype Vector3 = readonly [number, number, number]\nexport interface ObjectProps<N extends THREE.Object3D = THREE.Object3D>\n\textends CapabilityAttributes<`three`>, ThreeEventAttributes<N> {\n\tchildren?: Children\n\tposition?: Vector3\n\trotation?: Vector3\n\tscale?: Vector3 | number\n\tvisible?: boolean\n\tname?: string\n\tref?: (object: N | null) => void\n}\nconst constructors = {\n\tGroup: THREE.Group,\n\tMesh: THREE.Mesh,\n\tLineSegments: THREE.LineSegments,\n\tBufferGeometry: THREE.BufferGeometry,\n\tLineBasicMaterial: THREE.LineBasicMaterial,\n\tPerspectiveCamera: THREE.PerspectiveCamera,\n\tAmbientLight: THREE.AmbientLight,\n\tPointLight: THREE.PointLight,\n\tDirectionalLight: THREE.DirectionalLight,\n\tBoxGeometry: THREE.BoxGeometry,\n\tSphereGeometry: THREE.SphereGeometry,\n\tPlaneGeometry: THREE.PlaneGeometry,\n\tMeshStandardMaterial: THREE.MeshStandardMaterial,\n\tMeshBasicMaterial: THREE.MeshBasicMaterial,\n\tMeshNormalMaterial: THREE.MeshNormalMaterial,\n}\nconst drawableDefaults = new WeakMap<\n\tTHREE.Mesh | THREE.LineSegments,\n\t{\n\t\tgeometry: THREE.BufferGeometry\n\t\tmaterial: THREE.Material | THREE.Material[]\n\t\townsGeometry: boolean\n\t\townsMaterial: boolean\n\t}\n>()\nconst borrowedDrawableDefaults = new WeakMap<\n\tTHREE.Mesh | THREE.LineSegments,\n\t{\n\t\tgeometry: THREE.BufferGeometry\n\t\tmaterial: THREE.Material | THREE.Material[]\n\t}\n>()\nconst constructorArgs = new WeakMap<Resource, unknown[]>()\nconst eventHandlers = new WeakMap<Resource, Map<string, () => void>>()\nconst defaults = new WeakMap<Resource, Map<string, any>>()\nfunction writeProperty(node: Resource, key: string, value: any): void {\n\tconst target = node as any\n\tif (!(key in target)) throw new Error(`spa/three: unknown property ${key}`)\n\tconst current = target[key]\n\tif (current?.isColor) current.set(value)\n\telse if (Array.isArray(value) && typeof current?.set === `function`)\n\t\tcurrent.set(...value)\n\telse if (key === `scale` && typeof value === `number`) current.setScalar(value)\n\telse if (current?.copy && value?.constructor === current.constructor)\n\t\tcurrent.copy(value)\n\telse target[key] = value\n\tif (node instanceof THREE.PerspectiveCamera) node.updateProjectionMatrix()\n}\nconst renderer = createSceneRenderer<Resource>({\n\ttarget(node) {\n\t\treturn {\n\t\t\tkind: `three`,\n\t\t\tnode,\n\t\t\t...(node instanceof THREE.Object3D\n\t\t\t\t? {\n\t\t\t\t\t\tsuspend: () => suspendThree(node),\n\t\t\t\t\t\tlisten: (type: string, listener: () => void) =>\n\t\t\t\t\t\t\tlistenThree(node, type, listener),\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t\tread(key) {\n\t\t\t\tconst value = (node as any)[key]\n\t\t\t\treturn value?.isColor\n\t\t\t\t\t? value.getStyle()\n\t\t\t\t\t: value?.isVector3 || value?.isEuler\n\t\t\t\t\t\t? [value.x, value.y, value.z]\n\t\t\t\t\t\t: value\n\t\t\t},\n\t\t\twrite(key, value) {\n\t\t\t\twriteProperty(node, key, value)\n\t\t\t},\n\t\t}\n\t},\n\tcreate(type, props) {\n\t\tconst Constructor = constructors[type as keyof typeof constructors]\n\t\tif (!Constructor) throw new Error(`spa/three: unknown node ${type}`)\n\t\tconst node = new (Constructor as any)(...(props[`args`] ?? [])) as Resource\n\t\t// Drawables' implicit resources are replaced by owned JSX resources below.\n\t\tif (node instanceof THREE.Mesh || node instanceof THREE.LineSegments)\n\t\t\tdrawableDefaults.set(node, {\n\t\t\t\tgeometry: node.geometry,\n\t\t\t\tmaterial: node.material,\n\t\t\t\townsGeometry: props[`args`]?.[0] === undefined,\n\t\t\t\townsMaterial: props[`args`]?.[1] === undefined,\n\t\t\t})\n\t\tconstructorArgs.set(node, [...(props[`args`] ?? [])])\n\t\tdefaults.set(node, new Map())\n\t\teventHandlers.set(node, new Map())\n\t\treturn node\n\t},\n\tupdate(node, props, previous) {\n\t\tif (!equalArgs(constructorArgs.get(node)!, props[`args`]))\n\t\t\tthrow new Error(\n\t\t\t\t`spa/three: change the component key to replace constructor args`,\n\t\t\t)\n\t\tconst target = node as any\n\t\tconst saved = defaults.get(node)!\n\t\tfor (const key of new Set([\n\t\t\t...Object.keys(previous),\n\t\t\t...Object.keys(props),\n\t\t])) {\n\t\t\tif (\n\t\t\t\t/^(key|children|ref|args)$/.test(key) ||\n\t\t\t\tObject.is(props[key], previous[key])\n\t\t\t)\n\t\t\t\tcontinue\n\t\t\tif (key.startsWith(`on`)) {\n\t\t\t\tif (\n\t\t\t\t\t!(node instanceof THREE.Object3D) ||\n\t\t\t\t\t!/^on(Pointer(Down|Up|Move|Enter|Leave|Over|Out|Cancel)|Click)$/.test(\n\t\t\t\t\t\tkey,\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t\tthrow new Error(`spa/three: unknown event ${key}`)\n\t\t\t\tconst handlers = eventHandlers.get(node)!\n\t\t\t\thandlers.get(key)?.()\n\t\t\t\thandlers.delete(key)\n\t\t\t\tconst handler = props[key] as ThreeEventHandler | undefined\n\t\t\t\tif (handler) {\n\t\t\t\t\tconst scope = owner!\n\t\t\t\t\thandlers.set(\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tlistenThree(node, key.slice(2).toLowerCase(), (event) => {\n\t\t\t\t\t\t\twithin(scope, () => {\n\t\t\t\t\t\t\t\thandler(event)\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (!(key in target)) throw new Error(`spa/three: unknown property ${key}`)\n\t\t\tconst current = target[key]\n\t\t\tif (!saved.has(key))\n\t\t\t\tsaved.set(key, current?.clone ? current.clone() : current)\n\t\t\tconst value = props[key] === undefined ? saved.get(key) : props[key]\n\t\t\twriteProperty(node, key, value)\n\t\t}\n\t\tif (node instanceof THREE.PerspectiveCamera) node.updateProjectionMatrix()\n\t},\n\tchildren(parent, children, activeChildren) {\n\t\tif (!(parent instanceof THREE.Object3D)) {\n\t\t\tif (children.length)\n\t\t\t\tthrow new Error(`spa/three: resources cannot contain children`)\n\t\t\treturn\n\t\t}\n\t\tconst objects = children.filter(\n\t\t\t(child): child is THREE.Object3D => child instanceof THREE.Object3D,\n\t\t)\n\t\tif (\n\t\t\tparent.children.length !== objects.length ||\n\t\t\tobjects.some((child, index) => child !== parent.children[index])\n\t\t) {\n\t\t\tconst wanted = new Set(objects)\n\t\t\tfor (const child of [...parent.children])\n\t\t\t\tif (!wanted.has(child)) parent.remove(child)\n\t\t\tfor (const child of objects) if (child.parent !== parent) parent.add(child)\n\t\t\tparent.children.splice(0, parent.children.length, ...objects)\n\t\t}\n\t\tconst resources = children.filter(\n\t\t\t(child) => !(child instanceof THREE.Object3D),\n\t\t)\n\t\tif (\n\t\t\tresources.length &&\n\t\t\t!(parent instanceof THREE.Mesh || parent instanceof THREE.LineSegments)\n\t\t)\n\t\t\tthrow new Error(\n\t\t\t\t`spa/three: geometry and material require a Mesh or LineSegments parent`,\n\t\t\t)\n\t\tif (parent instanceof THREE.Mesh || parent instanceof THREE.LineSegments) {\n\t\t\tconst geometries = resources.filter(\n\t\t\t\t(child) => child instanceof THREE.BufferGeometry,\n\t\t\t)\n\t\t\tconst materials = resources.filter(\n\t\t\t\t(child) => child instanceof THREE.Material,\n\t\t\t)\n\t\t\tconst activeGeometries = activeChildren.filter(\n\t\t\t\t(child) => child instanceof THREE.BufferGeometry,\n\t\t\t)\n\t\t\tconst activeMaterials = activeChildren.filter(\n\t\t\t\t(child) => child instanceof THREE.Material,\n\t\t\t)\n\t\t\tif (activeGeometries.length > 1 || activeMaterials.length > 1)\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`spa/three: each ${parent instanceof THREE.Mesh ? `Mesh` : `LineSegments`} accepts one geometry and one material`,\n\t\t\t\t)\n\t\t\tconst owned = drawableDefaults.get(parent)\n\t\t\tlet baseline = owned ?? borrowedDrawableDefaults.get(parent)\n\t\t\tif (!baseline) {\n\t\t\t\tbaseline = { geometry: parent.geometry, material: parent.material }\n\t\t\t\tborrowedDrawableDefaults.set(parent, baseline)\n\t\t\t}\n\t\t\t// Retention owns outgoing resources without occupying incoming attachment slots.\n\t\t\tparent.geometry =\n\t\t\t\tactiveGeometries[0] ??\n\t\t\t\tgeometries.find((geometry) => geometry === parent.geometry) ??\n\t\t\t\tgeometries.at(-1) ??\n\t\t\t\tbaseline.geometry\n\t\t\tparent.material =\n\t\t\t\tactiveMaterials[0] ??\n\t\t\t\tmaterials.find((material) => material === parent.material) ??\n\t\t\t\tmaterials.at(-1) ??\n\t\t\t\tbaseline.material\n\t\t\tif (!owned && children.length === 0)\n\t\t\t\tborrowedDrawableDefaults.delete(parent)\n\t\t}\n\t},\n\tdestroy(node) {\n\t\teventHandlers.get(node)!.clear()\n\t\tif (node instanceof THREE.Object3D) {\n\t\t\ttry {\n\t\t\t\tforgetThree(node)\n\t\t\t} finally {\n\t\t\t\tnode.removeFromParent()\n\t\t\t\tif (node instanceof THREE.Mesh || node instanceof THREE.LineSegments) {\n\t\t\t\t\tconst owned = drawableDefaults.get(node)!\n\t\t\t\t\tif (owned.ownsGeometry) owned.geometry.dispose()\n\t\t\t\t\tif (owned.ownsMaterial) (owned.material as THREE.Material).dispose()\n\t\t\t\t}\n\t\t\t}\n\t\t} else node.dispose()\n\t},\n})\nfunction equalArgs(a: unknown[], b: unknown[] = []): boolean {\n\treturn (\n\t\ta.length === b.length &&\n\t\ta.every(\n\t\t\t(value, index) =>\n\t\t\t\tObject.is(value, b[index]) ||\n\t\t\t\t(Array.isArray(value) &&\n\t\t\t\t\tArray.isArray(b[index]) &&\n\t\t\t\t\tequalArgs(value, b[index])),\n\t\t)\n\t)\n}\n\nexport interface CanvasState {\n\tscene: THREE.Scene\n\tcamera: THREE.Camera\n\trenderer: THREE.WebGLRenderer\n}\nexport interface CanvasResizeState extends CanvasState {\n\twidth: number\n\theight: number\n\tdpr: number\n}\nexport interface CanvasProps {\n\tchildren?: Children\n\twidth?: number\n\theight?: number\n\tcamera?: THREE.Camera\n\t/** Constructor-time options. Canvas always supplies its own DOM canvas. */\n\trendererOptions?: Omit<THREE.WebGLRendererParameters, `canvas`>\n\t/** The returned renderer belongs exclusively to Canvas and is disposed with it. */\n\tcreateRenderer?: (\n\t\toptions: THREE.WebGLRendererParameters,\n\t) => THREE.WebGLRenderer\n\t/** Handle renderer creation failure locally, for example by offering an accessible fallback. */\n\tonError?: (error: unknown) => void\n\t/** A fixed ratio, or a device-pixel-ratio clamp. Defaults to 1. */\n\tdpr?: number | readonly [min: number, max: number]\n\t/** Runs after sizing and scene mounting, before the first draw. May return cleanup. */\n\tonCreated?: (state: CanvasState) => void | (() => void)\n\t/** Supplied cameras keep their projection; update it explicitly here if desired. */\n\tonResize?: (state: CanvasResizeState) => void\n\t/** Skip an idle GPU draw. Frame callbacks and pointer updates still run. */\n\trenderWhen?: () => boolean\n\tonFrame?: (state: CanvasState & { delta: number; time: number }) => void\n}\n/** Browser-only scene boundary. The camera prop is borrowed and never disposed. */\nexport function Canvas(props: CanvasProps): SpaElement {\n\tlet canvas: HTMLCanvasElement | null = null\n\tonMount(() => {\n\t\tconst parameters: THREE.WebGLRendererParameters = {\n\t\t\tantialias: true,\n\t\t\t...props.rendererOptions,\n\t\t\tcanvas: canvas!,\n\t\t}\n\t\tlet webgl: THREE.WebGLRenderer\n\t\ttry {\n\t\t\twebgl = props.createRenderer\n\t\t\t\t? props.createRenderer(parameters)\n\t\t\t\t: new THREE.WebGLRenderer(parameters)\n\t\t} catch (error) {\n\t\t\tif (!props.onError) throw error\n\t\t\tprops.onError(error)\n\t\t\treturn\n\t\t}\n\t\tonCleanup(() => {\n\t\t\twebgl.dispose()\n\t\t})\n\t\tif (webgl.domElement !== canvas)\n\t\t\tthrow new Error(`spa/three: renderer must use the supplied Canvas element`)\n\t\tconst scene = new THREE.Scene()\n\t\tconst camera = new THREE.PerspectiveCamera(50, 1, 0.1, 1000)\n\t\tcamera.position.z = 5\n\t\tconst view = canvas.ownerDocument.defaultView!\n\t\tconst size = () => ({\n\t\t\twidth: props.width ?? 800,\n\t\t\theight: props.height ?? 600,\n\t\t\tdpr: props.dpr ?? 1,\n\t\t\tactive: props.camera ?? camera,\n\t\t})\n\t\tconst resize = ({ width, height, dpr, active }: ReturnType<typeof size>) => {\n\t\t\tconst range = typeof dpr === `number` ? [dpr, dpr] : dpr\n\t\t\tif (\n\t\t\t\t![width, height, ...range].every(\n\t\t\t\t\t(value) => Number.isFinite(value) && value > 0,\n\t\t\t\t) ||\n\t\t\t\trange[0] > range[1]\n\t\t\t)\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`spa/three: dimensions and DPR must be positive with an ordered DPR range`,\n\t\t\t\t)\n\t\t\tconst ratio = Math.max(\n\t\t\t\trange[0],\n\t\t\t\tMath.min(range[1], view.devicePixelRatio || 1),\n\t\t\t)\n\t\t\twebgl.setPixelRatio(ratio)\n\t\t\twebgl.setSize(width, height)\n\t\t\tcamera.aspect = width / height\n\t\t\tcamera.updateProjectionMatrix()\n\t\t\tprops.onResize?.({\n\t\t\t\tscene,\n\t\t\t\tcamera: active,\n\t\t\t\trenderer: webgl,\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\tdpr: ratio,\n\t\t\t})\n\t\t}\n\t\tbindScene(size, resize)\n\t\tconst scope = owner!\n\t\tconst resized = () => {\n\t\t\ttry {\n\t\t\t\tresize(size())\n\t\t\t} catch (error) {\n\t\t\t\treportScopeError(scope, error)\n\t\t\t}\n\t\t}\n\t\tview.addEventListener(`resize`, resized)\n\t\tonCleanup(() => {\n\t\t\tview.removeEventListener(`resize`, resized)\n\t\t})\n\t\trenderer.mount(() => props.children, scene)\n\t\tconst events = createThreeEvents(\n\t\t\tcanvas,\n\t\t\tscene,\n\t\t\t() => props.camera ?? camera,\n\t\t\t(error) => {\n\t\t\t\treportScopeError(scope, error)\n\t\t\t},\n\t\t)\n\t\tonCleanup(() => {\n\t\t\tevents.dispose()\n\t\t})\n\t\t// Scene mounting queues child refs and mount hooks; setup must follow them.\n\t\tonMount(() => {\n\t\t\tconst cleanup = props.onCreated?.({\n\t\t\t\tscene,\n\t\t\t\tcamera: props.camera ?? camera,\n\t\t\t\trenderer: webgl,\n\t\t\t})\n\t\t\tif (cleanup) onCleanup(cleanup)\n\t\t\tlet last: number | undefined\n\t\t\tonSceneFrame((time) => {\n\t\t\t\tconst active = props.camera ?? camera\n\t\t\t\tconst delta = last === undefined ? 0 : (time - last) / 1000\n\t\t\t\tlast = time\n\t\t\t\tconst present = isPresent(scope)\n\t\t\t\tconst draw = !present || (props.renderWhen?.() ?? true)\n\t\t\t\tif (present)\n\t\t\t\t\tprops.onFrame?.({\n\t\t\t\t\t\tscene,\n\t\t\t\t\t\tcamera: active,\n\t\t\t\t\t\trenderer: webgl,\n\t\t\t\t\t\tdelta,\n\t\t\t\t\t\ttime: time / 1000,\n\t\t\t\t\t})\n\t\t\t\tevents.update()\n\t\t\t\tif (draw) webgl.render(scene, active)\n\t\t\t}, true)\n\t\t})\n\t})\n\treturn jsx(`canvas`, {\n\t\tref: (element: HTMLCanvasElement | null) => {\n\t\t\tcanvas = element\n\t\t},\n\t})\n}\nexport const Group = sceneComponent<ObjectProps>(`Group`)\nexport const Mesh = sceneComponent<\n\tObjectProps<THREE.Mesh> & {\n\t\targs?: ConstructorParameters<typeof THREE.Mesh>\n\t}\n>(`Mesh`)\nexport const PerspectiveCamera = sceneComponent<\n\tObjectProps<THREE.PerspectiveCamera> & {\n\t\targs?: ConstructorParameters<typeof THREE.PerspectiveCamera>\n\t\tfov?: number\n\t\taspect?: number\n\t\tnear?: number\n\t\tfar?: number\n\t}\n>(`PerspectiveCamera`)\nexport const AmbientLight = sceneComponent<\n\tObjectProps<THREE.Light> & {\n\t\tcolor?: THREE.ColorRepresentation\n\t\tintensity?: number\n\t}\n>(`AmbientLight`)\nexport const DirectionalLight = sceneComponent<\n\tObjectProps<THREE.Light> & {\n\t\tcolor?: THREE.ColorRepresentation\n\t\tintensity?: number\n\t}\n>(`DirectionalLight`)\nexport const PointLight = sceneComponent<\n\tObjectProps<THREE.PointLight> & {\n\t\tcolor?: THREE.ColorRepresentation\n\t\tintensity?: number\n\t\tdistance?: number\n\t\tdecay?: number\n\t}\n>(`PointLight`)\nexport const BoxGeometry = sceneComponent<{\n\targs?: ConstructorParameters<typeof THREE.BoxGeometry>\n\tref?: (node: THREE.BoxGeometry | null) => void\n}>(`BoxGeometry`)\nexport const SphereGeometry = sceneComponent<{\n\targs?: ConstructorParameters<typeof THREE.SphereGeometry>\n\tref?: (node: THREE.SphereGeometry | null) => void\n}>(`SphereGeometry`)\nexport const PlaneGeometry = sceneComponent<{\n\targs?: ConstructorParameters<typeof THREE.PlaneGeometry>\n\tref?: (node: THREE.PlaneGeometry | null) => void\n}>(`PlaneGeometry`)\nexport const MeshStandardMaterial = sceneComponent<\n\tTHREE.MeshStandardMaterialParameters &\n\t\tCapabilityAttributes<`three`> & {\n\t\t\tref?: (node: THREE.MeshStandardMaterial | null) => void\n\t\t}\n>(`MeshStandardMaterial`)\nexport const MeshBasicMaterial = sceneComponent<\n\tTHREE.MeshBasicMaterialParameters &\n\t\tCapabilityAttributes<`three`> & {\n\t\t\tref?: (node: THREE.MeshBasicMaterial | null) => void\n\t\t}\n>(`MeshBasicMaterial`)\nexport const MeshNormalMaterial = sceneComponent<\n\tTHREE.MeshNormalMaterialParameters &\n\t\tCapabilityAttributes<`three`> & {\n\t\t\tref?: (node: THREE.MeshNormalMaterial | null) => void\n\t\t}\n>(`MeshNormalMaterial`)\nexport { renderer as threeRenderer }\n\n/** Batched line geometry, with the same attachment and ownership rules as Mesh. */\nexport const LineSegments = sceneComponent<\n\tObjectProps<THREE.LineSegments> & {\n\t\targs?: ConstructorParameters<typeof THREE.LineSegments>\n\t\tfrustumCulled?: boolean\n\t}\n>(`LineSegments`)\nexport const BufferGeometry = sceneComponent<{\n\tref?: (node: THREE.BufferGeometry | null) => void\n}>(`BufferGeometry`)\nexport const LineBasicMaterial = sceneComponent<\n\tTHREE.LineBasicMaterialParameters & {\n\t\tref?: (node: THREE.LineBasicMaterial | null) => void\n\t}\n>(`LineBasicMaterial`)\n"],"mappings":";;;;;AAsCA,MAAM,4BAAY,IAAI,QAAwB;AAC9C,SAAgB,aAAa,MAAkC;CAC9D,UAAU,IAAI,IAAI;CAClB,KAAK,MAAM,WAAW,UAAU,QAAQ,OAAO,IAAI;CACnD,aAAa;EACZ,UAAU,OAAO,IAAI;CACtB;AACD;AACA,MAAM,4BAAY,IAAI,QAAmD;AACzE,MAAM,2BAAW,IAAI,IAA4C;AAEjE,SAAgB,YACf,MACA,MACA,SACa;CACb,MAAM,SAAS,UAAU,IAAI,IAAI,qBAAK,IAAI,IAA0B;CACpE,UAAU,IAAI,MAAM,MAAM;CAC1B,MAAM,WAAW,OAAO,IAAI,IAAI,qBAAK,IAAI,IAAa;CACtD,OAAO,IAAI,MAAM,QAAQ;CACzB,SAAS,IAAI,OAAO;CACpB,aAAa;EACZ,SAAS,OAAO,OAAO;EACvB,IAAI,CAAC,SAAS,MAAM,OAAO,OAAO,IAAI;CACvC;AACD;AACA,SAAgB,YAAY,MAA4B;CACvD,MAAM,SAAoB,CAAC;CAC3B,KAAK,MAAM,WAAW,UACrB,IAAI;EACH,QAAQ,OAAO,IAAI;CACpB,SAAS,OAAO;EACf,OAAO,KAAK,KAAK;CAClB;CAED,UAAU,OAAO,IAAI;CACrB,IAAI,OAAO,QAAQ,M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O,IAAI,UAAU,EACpB,MAAM,YAAsC;EAC3C,SAAS;CACV,EACD,CAAC;AACF;AACA,MAAa,QAAQ,eAA4B,OAAO;AACxD,MAAa,OAAO,eAIlB,MAAM;AACR,MAAa,oBAAoB,eAQ/B,mBAAmB;AACrB,MAAa,eAAe,eAK1B,cAAc;AAChB,MAAa,mBAAmB,eAK9B,kBAAkB;AACpB,MAAa,aAAa,eAOxB,YAAY;AACd,MAAa,cAAc,eAGxB,aAAa;AAChB,MAAa,iBAAiB,eAG3B,gBAAgB;AACnB,MAAa,gBAAgB,eAG1B,eAAe;AAClB,MAAa,uBAAuB,eAKlC,sBAAsB;AACxB,MAAa,oBAAoB,eAK/B,mBAAmB;AACrB,MAAa,qBAAqB,eAKhC,oBAAoB;;AAItB,MAAa,eAAe,eAK1B,cAAc;AAChB,MAAa,iBAAiB,eAE3B,gBAAgB;AACnB,MAAa,oBAAoB,eAI/B,mBAAmB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as AmbientLight, n as BoxGeometry, r as BufferGeometry, i as Canvas, a as DirectionalLight, o as Group, s as LineBasicMaterial, c as LineSegments, l as Mesh, u as MeshBasicMaterial, d as MeshNormalMaterial, f as MeshStandardMaterial, p as PerspectiveCamera, m as PlaneGeometry, h as PointLight, g as SphereGeometry, v as createThreeEvents, _ as threeRenderer } from "./three-
|
|
1
|
+
export { t as AmbientLight, n as BoxGeometry, r as BufferGeometry, i as Canvas, a as DirectionalLight, o as Group, s as LineBasicMaterial, c as LineSegments, l as Mesh, u as MeshBasicMaterial, d as MeshNormalMaterial, f as MeshStandardMaterial, p as PerspectiveCamera, m as PlaneGeometry, h as PointLight, g as SphereGeometry, v as createThreeEvents, _ as threeRenderer } from "./three-F5D1OnE9.js";
|