@atom.io/spa 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/README.md +30 -10
  2. package/README.mdx +16 -5
  3. package/dist/BrandMarkScene-CBYk-RJ2.js +140 -0
  4. package/dist/BrandMarkScene-CBYk-RJ2.js.map +1 -0
  5. package/dist/astro-client.js +1 -1
  6. package/dist/astro-server.js +1 -1
  7. package/dist/brand-css.d.ts +2 -0
  8. package/dist/brand-model.d.ts +32 -0
  9. package/dist/brand-model.d.ts.map +1 -0
  10. package/dist/brand-model.js +120 -0
  11. package/dist/brand-model.js.map +1 -0
  12. package/dist/brand.css +37 -0
  13. package/dist/brand.d.ts +13 -0
  14. package/dist/brand.d.ts.map +1 -0
  15. package/dist/brand.js +94 -0
  16. package/dist/brand.js.map +1 -0
  17. package/dist/client.min.js +1 -1
  18. package/dist/development/BrandMarkScene-BDdC7K5M.js +140 -0
  19. package/dist/development/BrandMarkScene-BDdC7K5M.js.map +1 -0
  20. package/dist/development/astro-client.js +1 -1
  21. package/dist/development/astro-server.js +1 -1
  22. package/dist/development/brand-model.js +120 -0
  23. package/dist/development/brand-model.js.map +1 -0
  24. package/dist/development/brand.css +37 -0
  25. package/dist/development/brand.js +94 -0
  26. package/dist/development/brand.js.map +1 -0
  27. package/dist/development/{dom-BRFv7FP_.js → dom-CEVtlaav.js} +4 -3
  28. package/dist/development/dom-CEVtlaav.js.map +1 -0
  29. package/dist/development/floating.js.map +1 -1
  30. package/dist/development/hot.js +2 -2
  31. package/dist/development/hot.js.map +1 -1
  32. package/dist/development/{identity-DwB8MTM1.js → identity-B8wTFkyW.js} +2 -2
  33. package/dist/development/{identity-DwB8MTM1.js.map → identity-B8wTFkyW.js.map} +1 -1
  34. package/dist/development/index.js +1 -1
  35. package/dist/development/konva.js +1 -1
  36. package/dist/development/motion.js +38 -19
  37. package/dist/development/motion.js.map +1 -1
  38. package/dist/development/renderer.js +1 -1
  39. package/dist/development/{server-renderer-u1-c5PGd.js → server-renderer-zAqEL1g1.js} +2 -2
  40. package/dist/development/{server-renderer-u1-c5PGd.js.map → server-renderer-zAqEL1g1.js.map} +1 -1
  41. package/dist/development/server.js +1 -1
  42. package/dist/development/three-CsZ6Od1C.js +527 -0
  43. package/dist/development/three-CsZ6Od1C.js.map +1 -0
  44. package/dist/development/three.js +1 -509
  45. package/dist/{dom--HZvmgqd.js → dom-DUpa3Sj2.js} +4 -3
  46. package/dist/dom-DUpa3Sj2.js.map +1 -0
  47. package/dist/floating.js.map +1 -1
  48. package/dist/hot.d.ts.map +1 -1
  49. package/dist/hot.js.map +1 -1
  50. package/dist/{identity-oFU5p-Qj.js → identity-ByJswZtF.js} +2 -2
  51. package/dist/{identity-oFU5p-Qj.js.map → identity-ByJswZtF.js.map} +1 -1
  52. package/dist/index-DdA39aMv.d.ts.map +1 -1
  53. package/dist/index.js +1 -1
  54. package/dist/konva.js +1 -1
  55. package/dist/motion.d.ts +2 -0
  56. package/dist/motion.d.ts.map +1 -1
  57. package/dist/motion.js +38 -19
  58. package/dist/motion.js.map +1 -1
  59. package/dist/renderer.js +1 -1
  60. package/dist/{server-renderer-BYFDmqnM.js → server-renderer-D7CdyOMo.js} +2 -2
  61. package/dist/{server-renderer-BYFDmqnM.js.map → server-renderer-D7CdyOMo.js.map} +1 -1
  62. package/dist/server.js +1 -1
  63. package/dist/size.json +12 -12
  64. package/dist/three-DcYxRXPW.js +527 -0
  65. package/dist/three-DcYxRXPW.js.map +1 -0
  66. package/dist/three.d.ts +21 -0
  67. package/dist/three.d.ts.map +1 -1
  68. package/dist/three.js +1 -509
  69. package/package.json +39 -19
  70. package/src/BrandMark.module.css +25 -0
  71. package/src/BrandMark.tsx +106 -0
  72. package/src/BrandMarkScene.module.css +10 -0
  73. package/src/BrandMarkScene.tsx +116 -0
  74. package/src/brand-css.d.ts +2 -0
  75. package/src/brand-model.ts +177 -0
  76. package/src/brand.ts +3 -0
  77. package/src/dom.ts +8 -1
  78. package/src/hot.ts +3 -2
  79. package/src/lasertag.d.ts +1 -0
  80. package/src/motion-layout.ts +55 -26
  81. package/src/motion.ts +3 -0
  82. package/src/three.ts +69 -22
  83. package/dist/development/dom-BRFv7FP_.js.map +0 -1
  84. package/dist/development/three.js.map +0 -1
  85. package/dist/dom--HZvmgqd.js.map +0 -1
  86. package/dist/three.js.map +0 -1
@@ -1,509 +1 @@
1
- import { D as within, c as isPresent, f as onMount, h as reportScopeError, p as owner, u as onCleanup } from "./core-DrUd8x25.js";
2
- import { n as jsx } from "./jsx-runtime-BGDPK50B.js";
3
- import { bindScene, createSceneRenderer, onSceneFrame, sceneComponent } from "./renderer.js";
4
- import * as THREE from "three";
5
- // src/three-events.ts
6
- const suspended = /* @__PURE__ */ new WeakSet();
7
- function suspendThree(node) {
8
- suspended.add(node);
9
- for (const manager of managers) manager.remove(node);
10
- return () => {
11
- suspended.delete(node);
12
- };
13
- }
14
- const listeners = /* @__PURE__ */ new WeakMap();
15
- const managers = /* @__PURE__ */ new Set();
16
- function listenThree(node, type, handler) {
17
- const events = listeners.get(node) ?? /* @__PURE__ */ new Map();
18
- listeners.set(node, events);
19
- const handlers = events.get(type) ?? /* @__PURE__ */ new Set();
20
- events.set(type, handlers);
21
- handlers.add(handler);
22
- return () => {
23
- handlers.delete(handler);
24
- if (!handlers.size) events.delete(type);
25
- };
26
- }
27
- function forgetThree(node) {
28
- const errors = [];
29
- for (const manager of managers) try {
30
- manager.remove(node);
31
- } catch (error) {
32
- errors.push(error);
33
- }
34
- listeners.delete(node);
35
- if (errors.length) throw new AggregateError(errors);
36
- }
37
- /** Attach raycast pointer routing to a canvas; usable with borrowed scene roots. */
38
- function createThreeEvents(canvas, scene, camera, onError = (error) => {
39
- throw error;
40
- }) {
41
- const raycaster = new THREE.Raycaster();
42
- const pointer = new THREE.Vector2();
43
- const hovering = /* @__PURE__ */ new Map();
44
- const pressed = /* @__PURE__ */ new Map();
45
- const captures = /* @__PURE__ */ new Map();
46
- const last = /* @__PURE__ */ new Map();
47
- let dead = false;
48
- const path = (node) => {
49
- const nodes = [];
50
- for (let at = node; at; at = at.parent) {
51
- nodes.push(at);
52
- if (at === scene) return nodes;
53
- }
54
- return [];
55
- };
56
- const contains = (node, child) => {
57
- for (let at = child; at; at = at.parent) if (at === node) return true;
58
- return false;
59
- };
60
- const eligible = (intersection) => {
61
- const nodes = path(intersection.object);
62
- if (!nodes.length || nodes.some((node) => !node.visible || suspended.has(node))) return false;
63
- const material = intersection.object.material;
64
- return !material || (Array.isArray(material) ? material[intersection.face?.materialIndex ?? 0]?.visible !== false : material.visible);
65
- };
66
- const pick = (event) => {
67
- const bounds = canvas.getBoundingClientRect();
68
- if (!bounds.width || !bounds.height) return void 0;
69
- const active = camera();
70
- scene.updateWorldMatrix(true, true);
71
- active.updateWorldMatrix(true, false);
72
- pointer.set((event.clientX - bounds.left) / bounds.width * 2 - 1, 1 - (event.clientY - bounds.top) / bounds.height * 2);
73
- raycaster.layers.mask = active.layers.mask;
74
- raycaster.setFromCamera(pointer, active);
75
- if (event.clientX < bounds.left || event.clientX > bounds.right || event.clientY < bounds.top || event.clientY > bounds.bottom) return void 0;
76
- const intersection = raycaster.intersectObject(scene, true).find(eligible);
77
- return intersection ? {
78
- node: intersection.object,
79
- intersection
80
- } : void 0;
81
- };
82
- const nativeCapture = (id) => {
83
- if (canvas.hasPointerCapture?.(id)) canvas.releasePointerCapture(id);
84
- };
85
- const dispatch = (type, hit, nativeEvent, nodes = path(hit.node)) => {
86
- let stopped = false;
87
- for (const node of nodes) {
88
- if (dead) break;
89
- const event = {
90
- type,
91
- nativeEvent,
92
- target: hit.node,
93
- currentTarget: node,
94
- intersection: hit.intersection,
95
- ray: raycaster.ray.clone(),
96
- pointerId: nativeEvent.pointerId,
97
- button: nativeEvent.button,
98
- buttons: nativeEvent.buttons,
99
- clientX: nativeEvent.clientX,
100
- clientY: nativeEvent.clientY,
101
- stopPropagation() {
102
- stopped = true;
103
- },
104
- preventDefault() {
105
- nativeEvent.preventDefault();
106
- },
107
- setPointerCapture() {
108
- canvas.setPointerCapture(nativeEvent.pointerId);
109
- captures.set(nativeEvent.pointerId, {
110
- node,
111
- intersection: hit.intersection
112
- });
113
- },
114
- releasePointerCapture() {
115
- if (captures.get(nativeEvent.pointerId)?.node === node) {
116
- captures.delete(nativeEvent.pointerId);
117
- nativeCapture(nativeEvent.pointerId);
118
- }
119
- },
120
- hasPointerCapture() {
121
- return captures.get(nativeEvent.pointerId)?.node === node;
122
- }
123
- };
124
- for (const handler of [...listeners.get(node)?.get(type) ?? []]) if (!dead && listeners.get(node)?.get(type)?.has(handler)) handler(event);
125
- if (stopped) break;
126
- }
127
- };
128
- const hover = (event, next) => {
129
- const previous = hovering.get(event.pointerId);
130
- if (previous?.node === next?.node) {
131
- if (next) hovering.set(event.pointerId, next);
132
- return;
133
- }
134
- const oldPath = previous ? path(previous.node) : [];
135
- const newPath = next ? path(next.node) : [];
136
- if (next) hovering.set(event.pointerId, next);
137
- else hovering.delete(event.pointerId);
138
- if (previous) {
139
- dispatch(`pointerout`, previous, event);
140
- for (const node of oldPath) if (!newPath.includes(node)) dispatch(`pointerleave`, previous, event, [node]);
141
- }
142
- if (next && path(next.node).length) {
143
- dispatch(`pointerover`, next, event);
144
- for (const node of newPath.reverse()) if (!oldPath.includes(node)) dispatch(`pointerenter`, next, event, [node]);
145
- }
146
- };
147
- const cancel = (event) => {
148
- const hit = captures.get(event.pointerId) ?? pressed.get(event.pointerId);
149
- captures.delete(event.pointerId);
150
- pressed.delete(event.pointerId);
151
- try {
152
- if (hit) dispatch(`pointercancel`, hit, event);
153
- } finally {
154
- nativeCapture(event.pointerId);
155
- }
156
- };
157
- const handle = (event) => {
158
- try {
159
- if (event.type === `lostpointercapture`) {
160
- cancel(event);
161
- return;
162
- }
163
- if (event.type === `pointercancel`) {
164
- cancel(event);
165
- hover(event);
166
- last.delete(event.pointerId);
167
- return;
168
- }
169
- if (event.type === `pointerleave`) {
170
- last.set(event.pointerId, event);
171
- hover(event);
172
- return;
173
- }
174
- last.set(event.pointerId, event);
175
- const hit = pick(event);
176
- hover(event, hit);
177
- if (dead) return;
178
- const capture = captures.get(event.pointerId);
179
- if (capture && hit && contains(capture.node, hit.node)) capture.intersection = hit.intersection;
180
- const delivery = capture ?? hit;
181
- if (event.type === `pointerdown`) {
182
- if (hit) {
183
- pressed.set(event.pointerId, hit);
184
- canvas.setPointerCapture?.(event.pointerId);
185
- }
186
- }
187
- if (event.type === `pointerup`) {
188
- const down = pressed.get(event.pointerId);
189
- pressed.delete(event.pointerId);
190
- try {
191
- if (down && !capture && down.node !== hit?.node) dispatch(`pointercancel`, down, event);
192
- if (delivery) dispatch(`pointerup`, delivery, event);
193
- if (down && down.node === hit?.node && event.button === 0) dispatch(`click`, hit, event);
194
- } finally {
195
- captures.delete(event.pointerId);
196
- nativeCapture(event.pointerId);
197
- if (event.pointerType === `touch`) {
198
- hover(event);
199
- last.delete(event.pointerId);
200
- }
201
- }
202
- } else if (delivery) dispatch(event.type, delivery, event);
203
- } catch (error) {
204
- onError(error);
205
- }
206
- };
207
- const events = [
208
- `pointerdown`,
209
- `pointerup`,
210
- `pointermove`,
211
- `pointerleave`,
212
- `pointercancel`,
213
- `lostpointercapture`
214
- ];
215
- for (const type of events) canvas.addEventListener(type, handle);
216
- const manager = {
217
- /** Re-pick stationary pointers after camera, geometry, or transforms change. */
218
- update() {
219
- if (dead) return;
220
- try {
221
- for (const event of last.values()) if (event.type !== `pointerleave`) hover(event, pick(event));
222
- } catch (error) {
223
- onError(error);
224
- }
225
- },
226
- remove(node) {
227
- const errors = [];
228
- for (const [id, hit] of hovering) if (contains(node, hit.node)) try {
229
- hover(last.get(id));
230
- } catch (error) {
231
- errors.push(error);
232
- }
233
- for (const [id, hit] of [...pressed, ...captures]) if (contains(node, hit.node)) try {
234
- cancel(last.get(id));
235
- } catch (error) {
236
- errors.push(error);
237
- }
238
- if (errors.length) throw new AggregateError(errors);
239
- },
240
- dispose() {
241
- if (dead) return;
242
- dead = true;
243
- for (const type of events) canvas.removeEventListener(type, handle);
244
- for (const id of /* @__PURE__ */ new Set([...pressed.keys(), ...captures.keys()])) nativeCapture(id);
245
- hovering.clear();
246
- pressed.clear();
247
- captures.clear();
248
- last.clear();
249
- managers.delete(manager);
250
- }
251
- };
252
- managers.add(manager);
253
- return manager;
254
- }
255
- // src/three.ts
256
- const constructors = {
257
- Group: THREE.Group,
258
- Mesh: THREE.Mesh,
259
- PerspectiveCamera: THREE.PerspectiveCamera,
260
- AmbientLight: THREE.AmbientLight,
261
- DirectionalLight: THREE.DirectionalLight,
262
- BoxGeometry: THREE.BoxGeometry,
263
- SphereGeometry: THREE.SphereGeometry,
264
- PlaneGeometry: THREE.PlaneGeometry,
265
- MeshStandardMaterial: THREE.MeshStandardMaterial,
266
- MeshBasicMaterial: THREE.MeshBasicMaterial,
267
- MeshNormalMaterial: THREE.MeshNormalMaterial
268
- };
269
- const meshDefaults = /* @__PURE__ */ new WeakMap();
270
- const borrowedMeshDefaults = /* @__PURE__ */ new WeakMap();
271
- const constructorArgs = /* @__PURE__ */ new WeakMap();
272
- const eventHandlers = /* @__PURE__ */ new WeakMap();
273
- const defaults = /* @__PURE__ */ new WeakMap();
274
- function writeProperty(node, key, value) {
275
- const target = node;
276
- if (!(key in target)) throw new Error(`spa/three: unknown property ${key}`);
277
- const current = target[key];
278
- if (current?.isColor) current.set(value);
279
- else if (Array.isArray(value) && typeof current?.set === `function`) current.set(...value);
280
- else if (key === `scale` && typeof value === `number`) current.setScalar(value);
281
- else if (current?.copy && value?.constructor === current.constructor) current.copy(value);
282
- else target[key] = value;
283
- if (node instanceof THREE.PerspectiveCamera) node.updateProjectionMatrix();
284
- }
285
- const renderer = createSceneRenderer({
286
- target(node) {
287
- return {
288
- kind: `three`,
289
- node,
290
- ...node instanceof THREE.Object3D ? {
291
- suspend: () => suspendThree(node),
292
- listen: (type, listener) => listenThree(node, type, listener)
293
- } : {},
294
- read(key) {
295
- const value = node[key];
296
- return value?.isColor ? value.getStyle() : value?.isVector3 || value?.isEuler ? [
297
- value.x,
298
- value.y,
299
- value.z
300
- ] : value;
301
- },
302
- write(key, value) {
303
- writeProperty(node, key, value);
304
- }
305
- };
306
- },
307
- create(type, props) {
308
- const Constructor = constructors[type];
309
- if (!Constructor) throw new Error(`spa/three: unknown node ${type}`);
310
- const node = new Constructor(...props[`args`] ?? []);
311
- if (node instanceof THREE.Mesh) meshDefaults.set(node, {
312
- geometry: node.geometry,
313
- material: node.material,
314
- ownsGeometry: props[`args`]?.[0] === void 0,
315
- ownsMaterial: props[`args`]?.[1] === void 0
316
- });
317
- constructorArgs.set(node, [...props[`args`] ?? []]);
318
- defaults.set(node, /* @__PURE__ */ new Map());
319
- eventHandlers.set(node, /* @__PURE__ */ new Map());
320
- return node;
321
- },
322
- update(node, props, previous) {
323
- if (!equalArgs(constructorArgs.get(node), props[`args`])) throw new Error(`spa/three: change the component key to replace constructor args`);
324
- const target = node;
325
- const saved = defaults.get(node);
326
- for (const key of /* @__PURE__ */ new Set([...Object.keys(previous), ...Object.keys(props)])) {
327
- if (/^(key|children|ref|args)$/.test(key) || Object.is(props[key], previous[key])) continue;
328
- if (key.startsWith(`on`)) {
329
- if (!(node instanceof THREE.Object3D) || !/^on(Pointer(Down|Up|Move|Enter|Leave|Over|Out|Cancel)|Click)$/.test(key)) throw new Error(`spa/three: unknown event ${key}`);
330
- const handlers = eventHandlers.get(node);
331
- handlers.get(key)?.();
332
- handlers.delete(key);
333
- const handler = props[key];
334
- if (handler) {
335
- const scope = owner;
336
- handlers.set(key, listenThree(node, key.slice(2).toLowerCase(), (event) => {
337
- within(scope, () => {
338
- handler(event);
339
- });
340
- }));
341
- }
342
- continue;
343
- }
344
- if (!(key in target)) throw new Error(`spa/three: unknown property ${key}`);
345
- const current = target[key];
346
- if (!saved.has(key)) saved.set(key, current?.clone ? current.clone() : current);
347
- writeProperty(node, key, props[key] === void 0 ? saved.get(key) : props[key]);
348
- }
349
- if (node instanceof THREE.PerspectiveCamera) node.updateProjectionMatrix();
350
- },
351
- children(parent, children, activeChildren) {
352
- if (!(parent instanceof THREE.Object3D)) {
353
- if (children.length) throw new Error(`spa/three: resources cannot contain children`);
354
- return;
355
- }
356
- const objects = children.filter((child) => child instanceof THREE.Object3D);
357
- if (parent.children.length !== objects.length || objects.some((child, index) => child !== parent.children[index])) {
358
- const wanted = new Set(objects);
359
- for (const child of [...parent.children]) if (!wanted.has(child)) parent.remove(child);
360
- for (const child of objects) if (child.parent !== parent) parent.add(child);
361
- parent.children.splice(0, parent.children.length, ...objects);
362
- }
363
- const resources = children.filter((child) => !(child instanceof THREE.Object3D));
364
- if (resources.length && !(parent instanceof THREE.Mesh)) throw new Error(`spa/three: geometry and material require a Mesh parent`);
365
- if (parent instanceof THREE.Mesh) {
366
- const geometries = resources.filter((child) => child instanceof THREE.BufferGeometry);
367
- const materials = resources.filter((child) => child instanceof THREE.Material);
368
- const activeGeometries = activeChildren.filter((child) => child instanceof THREE.BufferGeometry);
369
- const activeMaterials = activeChildren.filter((child) => child instanceof THREE.Material);
370
- if (activeGeometries.length > 1 || activeMaterials.length > 1) throw new Error(`spa/three: each Mesh accepts one geometry and one material`);
371
- const owned = meshDefaults.get(parent);
372
- let baseline = owned ?? borrowedMeshDefaults.get(parent);
373
- if (!baseline) {
374
- baseline = {
375
- geometry: parent.geometry,
376
- material: parent.material
377
- };
378
- borrowedMeshDefaults.set(parent, baseline);
379
- }
380
- parent.geometry = activeGeometries[0] ?? geometries.find((geometry) => geometry === parent.geometry) ?? geometries.at(-1) ?? baseline.geometry;
381
- parent.material = activeMaterials[0] ?? materials.find((material) => material === parent.material) ?? materials.at(-1) ?? baseline.material;
382
- if (!owned && children.length === 0) borrowedMeshDefaults.delete(parent);
383
- }
384
- },
385
- destroy(node) {
386
- eventHandlers.get(node).clear();
387
- if (node instanceof THREE.Object3D) try {
388
- forgetThree(node);
389
- } finally {
390
- node.removeFromParent();
391
- if (node instanceof THREE.Mesh) {
392
- const owned = meshDefaults.get(node);
393
- if (owned.ownsGeometry) owned.geometry.dispose();
394
- if (owned.ownsMaterial) owned.material.dispose();
395
- }
396
- }
397
- else node.dispose();
398
- }
399
- });
400
- function equalArgs(a, b = []) {
401
- return a.length === b.length && a.every((value, index) => Object.is(value, b[index]) || Array.isArray(value) && Array.isArray(b[index]) && equalArgs(value, b[index]));
402
- }
403
- /** Browser-only scene boundary. The camera prop is borrowed and never disposed. */
404
- function Canvas(props) {
405
- let canvas = null;
406
- onMount(() => {
407
- const parameters = {
408
- antialias: true,
409
- ...props.rendererOptions,
410
- canvas
411
- };
412
- const webgl = props.createRenderer ? props.createRenderer(parameters) : new THREE.WebGLRenderer(parameters);
413
- onCleanup(() => {
414
- webgl.dispose();
415
- });
416
- if (webgl.domElement !== canvas) throw new Error(`spa/three: renderer must use the supplied Canvas element`);
417
- const scene = new THREE.Scene();
418
- const camera = new THREE.PerspectiveCamera(50, 1, .1, 1e3);
419
- camera.position.z = 5;
420
- const view = canvas.ownerDocument.defaultView;
421
- const size = () => ({
422
- width: props.width ?? 800,
423
- height: props.height ?? 600,
424
- dpr: props.dpr ?? 1,
425
- active: props.camera ?? camera
426
- });
427
- const resize = ({ width, height, dpr, active }) => {
428
- const range = typeof dpr === `number` ? [dpr, dpr] : dpr;
429
- if (![
430
- width,
431
- height,
432
- ...range
433
- ].every((value) => Number.isFinite(value) && value > 0) || range[0] > range[1]) throw new Error(`spa/three: dimensions and DPR must be positive with an ordered DPR range`);
434
- const ratio = Math.max(range[0], Math.min(range[1], view.devicePixelRatio || 1));
435
- webgl.setPixelRatio(ratio);
436
- webgl.setSize(width, height);
437
- camera.aspect = width / height;
438
- camera.updateProjectionMatrix();
439
- props.onResize?.({
440
- scene,
441
- camera: active,
442
- renderer: webgl,
443
- width,
444
- height,
445
- dpr: ratio
446
- });
447
- };
448
- bindScene(size, resize);
449
- const scope = owner;
450
- const resized = () => {
451
- try {
452
- resize(size());
453
- } catch (error) {
454
- reportScopeError(scope, error);
455
- }
456
- };
457
- view.addEventListener(`resize`, resized);
458
- onCleanup(() => {
459
- view.removeEventListener(`resize`, resized);
460
- });
461
- renderer.mount(() => props.children, scene);
462
- const events = createThreeEvents(canvas, scene, () => props.camera ?? camera, (error) => {
463
- reportScopeError(scope, error);
464
- });
465
- onCleanup(() => {
466
- events.dispose();
467
- });
468
- onMount(() => {
469
- const cleanup = props.onCreated?.({
470
- scene,
471
- camera: props.camera ?? camera,
472
- renderer: webgl
473
- });
474
- if (cleanup) onCleanup(cleanup);
475
- let last;
476
- onSceneFrame((time) => {
477
- const active = props.camera ?? camera;
478
- const delta = last === void 0 ? 0 : (time - last) / 1e3;
479
- last = time;
480
- if (isPresent(scope)) props.onFrame?.({
481
- scene,
482
- camera: active,
483
- renderer: webgl,
484
- delta,
485
- time: time / 1e3
486
- });
487
- events.update();
488
- webgl.render(scene, active);
489
- }, true);
490
- });
491
- });
492
- return jsx(`canvas`, { ref: (element) => {
493
- canvas = element;
494
- } });
495
- }
496
- const Group = sceneComponent(`Group`);
497
- const Mesh = sceneComponent(`Mesh`);
498
- const PerspectiveCamera = sceneComponent(`PerspectiveCamera`);
499
- const AmbientLight = sceneComponent(`AmbientLight`);
500
- const DirectionalLight = sceneComponent(`DirectionalLight`);
501
- const BoxGeometry = sceneComponent(`BoxGeometry`);
502
- const SphereGeometry = sceneComponent(`SphereGeometry`);
503
- const PlaneGeometry = sceneComponent(`PlaneGeometry`);
504
- const MeshStandardMaterial = sceneComponent(`MeshStandardMaterial`);
505
- const MeshBasicMaterial = sceneComponent(`MeshBasicMaterial`);
506
- const MeshNormalMaterial = sceneComponent(`MeshNormalMaterial`);
507
- export { AmbientLight, BoxGeometry, Canvas, DirectionalLight, Group, Mesh, MeshBasicMaterial, MeshNormalMaterial, MeshStandardMaterial, PerspectiveCamera, PlaneGeometry, SphereGeometry, createThreeEvents, renderer as threeRenderer };
508
-
509
- //# sourceMappingURL=three.js.map
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-CsZ6Od1C.js";
@@ -1,4 +1,4 @@
1
- import { i as capabilityProps, n as trackKeys, t as identifyChildren } from "./identity-oFU5p-Qj.js";
1
+ import { i as capabilityProps, n as trackKeys, t as identifyChildren } from "./identity-ByJswZtF.js";
2
2
  import { D as within, a as enqueue, c as isPresent, i as dispose, l as observe, m as plain, n as createRoot, o as fail, r as createScope, s as invalidate, v as untrack } from "./core-DD2giR6E.js";
3
3
  import { a as instanceProps, t as Fragment } from "./jsx-runtime-BGDPK50B.js";
4
4
  // src/dom-forms.ts
@@ -191,9 +191,10 @@ function mount(value, parent, before, owner, namespace, cursor, source = () => v
191
191
  mount(child, parent, at, childOwner, namespace, initial, () => held._value, key);
192
192
  record._end = comment(`]`, parent, at, childOwner, initial);
193
193
  } else {
194
+ const reusable = record._value === child && typeof child === `object` && child !== null && Object.isFrozen(child) && Object.isFrozen(child.props);
194
195
  record._value = child;
195
196
  owner._root._presence?.resume(record._scope);
196
- invalidate(record._scope);
197
+ if (!reusable) invalidate(record._scope);
197
198
  }
198
199
  record._index = index;
199
200
  previous = record;
@@ -339,4 +340,4 @@ function hydrate(setup, host, options = {}) {
339
340
  }
340
341
  export { render as n, hydrate as t };
341
342
 
342
- //# sourceMappingURL=dom--HZvmgqd.js.map
343
+ //# sourceMappingURL=dom-DUpa3Sj2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom-DUpa3Sj2.js","names":[],"sources":["../src/dom-forms.ts","../src/dom.ts"],"sourcesContent":["import type { Scope } from \"./core.ts\"\nimport { enqueue, isPresent } from \"./core.ts\"\n\ntype Control = HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement\nconst changes = new WeakMap<EventListener, EventListener>()\nconst requests = new WeakMap<Element, () => void>()\nconst events = [`input`, `change`, `click`]\nconst wake = () => {}\n\n/** Keep native input events, using per-edit change semantics for text/range controls. */\nexport function changeHandler(handler: EventListener): EventListener {\n\tlet wrapped = changes.get(handler)\n\tif (!wrapped) {\n\t\twrapped = (event) => {\n\t\t\tconst target = event.target as Control | null\n\t\t\tconst editing =\n\t\t\t\ttarget?.localName === `textarea` ||\n\t\t\t\t(target?.localName === `input` &&\n\t\t\t\t\t!/^(checkbox|radio|file)$/.test(target.type))\n\t\t\tif (event.type === (editing ? `input` : `change`))\n\t\t\t\thandler.call(event.currentTarget, event)\n\t\t}\n\t\tchanges.set(handler, wrapped)\n\t}\n\treturn wrapped\n}\n\nexport function controlValue(control: Control, value: string | number): void {\n\tif (\n\t\tcontrol.localName === `input` &&\n\t\tcontrol.type === `number` &&\n\t\ttypeof value === `number` &&\n\t\tcontrol.value !== `` &&\n\t\tNumber(control.value) === value\n\t)\n\t\treturn\n\tif (control.value !== String(value)) control.value = String(value)\n\tif (control.localName === `select`) {\n\t\tconst select = control as HTMLSelectElement\n\t\tif (select.selectedIndex < 0) {\n\t\t\tconst first = [...select.options].find((option) => !option.disabled)\n\t\t\tif (first) first.selected = true\n\t\t}\n\t}\n}\n\nfunction requestRestore(control: Control): void {\n\trequests.get(control)?.()\n\tif (control.localName !== `input` || control.type !== `radio`) return\n\tconst input = control as HTMLInputElement\n\tfor (const peer of (\n\t\tinput.getRootNode() as ParentNode\n\t).querySelectorAll<HTMLInputElement>(`input`)) {\n\t\tif (\n\t\t\tpeer !== input &&\n\t\t\tpeer.type === `radio` &&\n\t\t\tpeer.name === input.name &&\n\t\t\tpeer.form === input.form\n\t\t)\n\t\t\trequests.get(peer)?.()\n\t}\n}\n\n/** Restore controlled fields after event handlers and all queued option/prop updates. */\nexport function bindForm(\n\tcontrol: Control,\n\tprops: Record<string, any>,\n\tscope: Scope,\n): void {\n\tlet active: Event | undefined\n\tlet timer: ReturnType<typeof setTimeout> | undefined\n\tconst restore = () => {\n\t\tif (!isPresent(scope)) return true\n\t\tconst value = props[`value`]\n\t\tconst checked = control.localName === `input` ? props[`checked`] : undefined\n\t\tif (active?.eventPhase) return value == null && checked == null\n\t\tif (value != null) controlValue(control, value)\n\t\tif (checked != null) {\n\t\t\tconst input = control as HTMLInputElement\n\t\t\tif (input.checked !== Boolean(checked)) input.checked = Boolean(checked)\n\t\t}\n\t\treturn true\n\t}\n\tconst finish = () => {\n\t\tactive = undefined\n\t\tclearTimeout(timer)\n\t\tenqueue(scope, wake)\n\t}\n\tconst capture = (event: Event) => {\n\t\tif (event.type === `click` && !/^(checkbox|radio)$/.test(control.type))\n\t\t\treturn\n\t\tactive = event\n\t\tclearTimeout(timer)\n\t\t// A stopped native event never reaches the root's bubble listener.\n\t\ttimer = setTimeout(() => {\n\t\t\trequestRestore(control)\n\t\t}, 0)\n\t}\n\tconst root = scope._root\n\tif (!root._forms) {\n\t\troot._forms = new Set()\n\t\tconst end = (event: Event) => {\n\t\t\tconst target = event.target as Control\n\t\t\t// Checkbox/radio change follows click and input; its handlers must see the edit.\n\t\t\tif (\n\t\t\t\tevent.type === `click` ||\n\t\t\t\t(event.type === `input` && /^(checkbox|radio)$/.test(target.type))\n\t\t\t)\n\t\t\t\treturn\n\t\t\trequestRestore(target)\n\t\t}\n\t\tfor (const event of events) root._host!.addEventListener(event, end)\n\t\troot._cleanups.add(() => {\n\t\t\tfor (const event of events) root._host!.removeEventListener(event, end)\n\t\t})\n\t}\n\tconst forms = root._forms\n\tforms.add(restore)\n\trequests.set(control, finish)\n\tfor (const event of events) control.addEventListener(event, capture, true)\n\tscope._cleanups.add(() => {\n\t\tclearTimeout(timer)\n\t\tforms.delete(restore)\n\t\trequests.delete(control)\n\t\tfor (const event of events) control.removeEventListener(event, capture, true)\n\t})\n}\n","import type { Canonical } from \"atom.io/foundations/canonical\"\n\nimport { capabilityProps } from \"./capabilities.ts\"\nimport type {\n\tAccessor,\n\tChildren,\n\tRootOptions,\n\tScope,\n\tSpaElement,\n} from \"./core.ts\"\nimport {\n\tcreateRoot,\n\tcreateScope,\n\tdispose,\n\tfail,\n\tinvalidate,\n\tobserve,\n\tplain,\n\tuntrack,\n\twithin,\n} from \"./core.ts\"\nimport { bindForm, changeHandler, controlValue } from \"./dom-forms.ts\"\nimport { hotRoot, trackRoot } from \"./hot.ts\"\nimport { identifyChildren, trackKeys } from \"./identity.ts\"\nimport { Fragment } from \"./jsx-runtime.ts\"\nimport type { PresenceCollection } from \"./presence.ts\"\nimport { instanceProps } from \"./props.ts\"\n\nconst HTML = `http://www.w3.org/1999/xhtml`\nconst SVG = `http://www.w3.org/2000/svg`\ntype Cursor = {\n\tnode: Node | null\n\treport(expected: Node | null, found: Node | null): void\n}\ntype RecordNode = {\n\t_value: Children\n\t_scope: Scope\n\t_start: Node\n\t_end: Node\n\t_index: number\n}\nfunction compatible(record: RecordNode, child: Children): boolean {\n\treturn (\n\t\ttypeof record._value === typeof child &&\n\t\t(record._value as SpaElement | null)?.type ===\n\t\t\t(child as SpaElement | null)?.type\n\t)\n}\n\nfunction finish(cursor?: Cursor): void {\n\tif (cursor?.node) {\n\t\tcursor.report(null, cursor.node)\n\t\twhile (cursor.node) {\n\t\t\tconst node: Node = cursor.node\n\t\t\tcursor.node = node.nextSibling\n\t\t\t;(node as ChildNode).remove()\n\t\t}\n\t}\n}\n\nfunction take(\n\tnode: Node,\n\tparent: Node,\n\tbefore: Node | null,\n\towner: Scope,\n\tcursor?: Cursor,\n): Node {\n\tif (\n\t\tcursor &&\n\t\t!(node.nodeType === 3 && !node.nodeValue && cursor.node?.nodeType !== 3)\n\t) {\n\t\tconst found = cursor.node\n\t\tif (\n\t\t\t!found ||\n\t\t\tfound.nodeType !== node.nodeType ||\n\t\t\tfound.nodeName !== node.nodeName ||\n\t\t\t(found as Element).namespaceURI !== (node as Element).namespaceURI ||\n\t\t\t(node.nodeType !== 1 && found.nodeValue !== node.nodeValue)\n\t\t) {\n\t\t\tcursor.report(node, found)\n\t\t\tparent.insertBefore(node, found)\n\t\t\tcursor.node = found?.nextSibling ?? null\n\t\t\t;(found as ChildNode | null)?.remove()\n\t\t} else {\n\t\t\tnode = found\n\t\t\tcursor.node = found.nextSibling\n\t\t}\n\t} else parent.insertBefore(node, cursor ? cursor.node : before)\n\towner._cleanups.add(() => {\n\t\t;(node as ChildNode).remove()\n\t})\n\treturn node\n}\nfunction comment(\n\tvalue: string,\n\tparent: Node,\n\tbefore: Node | null,\n\towner: Scope,\n\tcursor?: Cursor,\n): Node {\n\treturn take(\n\t\tparent.ownerDocument!.createComment(value),\n\t\tparent,\n\t\tbefore,\n\t\towner,\n\t\tcursor,\n\t)\n}\nfunction property(\n\telement: Element,\n\tkey: string,\n\tvalue: any,\n\tprevious: any,\n): void {\n\tif (/^(key|children|ref)$/.test(key)) return\n\tif (key === `innerHTML` && element.localName === `astro-slot`) return\n\tif (\n\t\t/^(innerHTML|outerHTML|textContent|innerText|dangerouslySetInnerHTML)$/.test(\n\t\t\tkey,\n\t\t)\n\t)\n\t\tthrow new Error(import.meta.env.DEV ? `spa: owned content` : undefined)\n\tif (key.startsWith(`on`)) {\n\t\tconst capture = /(?<!Pointer)Capture$/.test(key)\n\t\tconst event = key\n\t\t\t.slice(2, capture ? -7 : undefined)\n\t\t\t.toLowerCase()\n\t\t\t.replace(`doubleclick`, `dblclick`)\n\t\tconst events =\n\t\t\tevent === `change`\n\t\t\t\t? [`input`, `change`]\n\t\t\t\t: [event === `focus` ? `focusin` : event === `blur` ? `focusout` : event]\n\t\tif (previous)\n\t\t\tfor (const name of events)\n\t\t\t\telement.removeEventListener(\n\t\t\t\t\tname,\n\t\t\t\t\tevent === `change` ? changeHandler(previous) : previous,\n\t\t\t\t\tcapture,\n\t\t\t\t)\n\t\tif (value != null) {\n\t\t\tif (import.meta.env.DEV && typeof value !== `function`)\n\t\t\t\tthrow new Error(`spa: event handler`)\n\t\t\tfor (const name of events)\n\t\t\t\telement.addEventListener(\n\t\t\t\t\tname,\n\t\t\t\t\tevent === `change` ? changeHandler(value) : value,\n\t\t\t\t\tcapture,\n\t\t\t\t)\n\t\t}\n\t\treturn\n\t}\n\tif (key === `className`) key = `class`\n\tif (key === `htmlFor`) key = `for`\n\tif (\n\t\timport.meta.env.DEV &&\n\t\tkey === `style` &&\n\t\tvalue != null &&\n\t\ttypeof value !== `string`\n\t)\n\t\tthrow new Error(`spa: CSS string required`)\n\tif (\n\t\telement.namespaceURI === SVG &&\n\t\tkey === `focusable` &&\n\t\ttypeof value === `boolean`\n\t)\n\t\tvalue = String(value)\n\tif (\n\t\telement.namespaceURI === HTML &&\n\t\tkey in element &&\n\t\t!/^(style|form|list)$/.test(key)\n\t) {\n\t\tconst target = element as any\n\t\tif (\n\t\t\tkey === `value` &&\n\t\t\t/^(input|textarea|select)$/.test(element.localName) &&\n\t\t\tvalue != null\n\t\t)\n\t\t\tcontrolValue(target, value)\n\t\telse target[key] = value ?? (typeof target[key] === `boolean` ? false : ``)\n\t\tif (value == null) element.removeAttribute(key)\n\t} else if (value == null || (value === false && !/^(aria-|data-)/.test(key)))\n\t\telement.removeAttribute(key)\n\telse\n\t\telement.setAttribute(\n\t\t\tkey,\n\t\t\tvalue === true && !/^(aria-|data-)/.test(key) ? `` : String(value),\n\t\t)\n}\n\nfunction mount(\n\tvalue: Children,\n\tparent: Node,\n\tbefore: Node | null,\n\towner: Scope,\n\tnamespace: string,\n\tcursor?: Cursor,\n\tsource = () => value,\n\tinitialKey?: Canonical,\n): void {\n\tif (typeof value === `function`) {\n\t\tconst begin = comment(`{`, parent, before, owner, cursor)\n\t\tlet end: Node | null = null\n\t\tlet records = new Map<string | number, RecordNode>()\n\t\tlet presence: PresenceCollection<RecordNode, Children> | undefined\n\t\tconst retire = (\n\t\t\trecord: RecordNode,\n\t\t\tkey: unknown,\n\t\t\teligible: boolean,\n\t\t\tindex: number,\n\t\t) => {\n\t\t\tif (presence) presence.remove(record, key, eligible, index, () => {})\n\t\t\telse dispose(record._scope)\n\t\t}\n\t\tlet initial = cursor\n\t\tobserve(\n\t\t\towner,\n\t\t\t() => identifyChildren((source() as () => Children)()),\n\t\t\t(values) => {\n\t\t\t\tpresence ??= owner._root._presence?.collection(\n\t\t\t\t\t(record: RecordNode) => record._scope,\n\t\t\t\t\tcompatible,\n\t\t\t\t)\n\t\t\t\tconst kept = new Map<string | number, RecordNode>()\n\t\t\t\tlet previous: RecordNode | undefined\n\t\t\t\tconst focus = parent.ownerDocument!.activeElement as HTMLElement | null\n\t\t\t\tfor (let index = 0; index < values.length; index++) {\n\t\t\t\t\tconst { value: child, key, id } = values[index]\n\t\t\t\t\tlet record = records.get(id)\n\t\t\t\t\tif (record && !compatible(record, child)) {\n\t\t\t\t\t\tretire(\n\t\t\t\t\t\t\trecord,\n\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\tchild == null || typeof child === `boolean`,\n\t\t\t\t\t\t\trecord._index,\n\t\t\t\t\t\t)\n\t\t\t\t\t\trecord = undefined\n\t\t\t\t\t}\n\t\t\t\t\trecord ??= presence?.take(id, child)\n\t\t\t\t\tif (!record) {\n\t\t\t\t\t\tconst at = previous ? previous._end.nextSibling : begin.nextSibling\n\t\t\t\t\t\tconst childOwner = createScope(owner)\n\t\t\t\t\t\trecord = {\n\t\t\t\t\t\t\t_index: index,\n\t\t\t\t\t\t\t_value: child,\n\t\t\t\t\t\t\t_scope: childOwner,\n\t\t\t\t\t\t\t_start: comment(`[`, parent, at, childOwner, initial),\n\t\t\t\t\t\t\t_end: null!,\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst held = record\n\t\t\t\t\t\tmount(\n\t\t\t\t\t\t\tchild,\n\t\t\t\t\t\t\tparent,\n\t\t\t\t\t\t\tat,\n\t\t\t\t\t\t\tchildOwner,\n\t\t\t\t\t\t\tnamespace,\n\t\t\t\t\t\t\tinitial,\n\t\t\t\t\t\t\t() => held._value,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t)\n\t\t\t\t\t\trecord._end = comment(`]`, parent, at, childOwner, initial)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Frozen descriptors opt into reuse; mutable props and accessors must refresh.\n\t\t\t\t\t\tconst reusable =\n\t\t\t\t\t\t\trecord._value === child &&\n\t\t\t\t\t\t\ttypeof child === `object` &&\n\t\t\t\t\t\t\tchild !== null &&\n\t\t\t\t\t\t\tObject.isFrozen(child) &&\n\t\t\t\t\t\t\tObject.isFrozen((child as SpaElement).props)\n\t\t\t\t\t\trecord._value = child\n\t\t\t\t\t\towner._root._presence?.resume(record._scope)\n\t\t\t\t\t\tif (!reusable) invalidate(record._scope)\n\t\t\t\t\t}\n\t\t\t\t\trecord._index = index\n\t\t\t\t\tprevious = record\n\t\t\t\t\tkept.set(id, record)\n\t\t\t\t}\n\t\t\t\tfor (const [key, record] of records)\n\t\t\t\t\tif (!kept.has(key)) retire(record, key, true, record._index)\n\t\t\t\tif (!initial) {\n\t\t\t\t\tlet at = end ?? before\n\t\t\t\t\tconst rendered = presence?.merge([...kept.values()]) ?? [\n\t\t\t\t\t\t...kept.values(),\n\t\t\t\t\t]\n\t\t\t\t\tfor (const record of rendered.reverse()) {\n\t\t\t\t\t\tif (record._end.nextSibling !== at) {\n\t\t\t\t\t\t\tconst range = parent.ownerDocument!.createRange()\n\t\t\t\t\t\t\trange.setStartBefore(record._start)\n\t\t\t\t\t\t\trange.setEndAfter(record._end)\n\t\t\t\t\t\t\tparent.insertBefore(range.extractContents(), at)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tat = record._start\n\t\t\t\t\t}\n\t\t\t\t\tif (\n\t\t\t\t\t\tfocus?.isConnected &&\n\t\t\t\t\t\t!focus.closest(`[inert]`) &&\n\t\t\t\t\t\tfocus !== parent.ownerDocument!.activeElement\n\t\t\t\t\t)\n\t\t\t\t\t\tfocus.focus({ preventScroll: true })\n\t\t\t\t}\n\t\t\t\tinitial = undefined\n\t\t\t\trecords = kept\n\t\t\t},\n\t\t)\n\t\tend = comment(`}`, parent, before, owner, cursor)\n\t\treturn\n\t}\n\tif (Array.isArray(value)) {\n\t\tfor (const child of value)\n\t\t\tmount(child, parent, before, owner, namespace, cursor)\n\t\treturn\n\t}\n\tif (value == null || typeof value === `boolean`) return\n\tif (typeof value !== `object`) {\n\t\tcomment(`t`, parent, before, owner, cursor)\n\t\tconst text = take(\n\t\t\tparent.ownerDocument!.createTextNode(String(value)),\n\t\t\tparent,\n\t\t\tbefore,\n\t\t\towner,\n\t\t\tcursor,\n\t\t)\n\t\tobserve(owner, source as Accessor<string | number | bigint>, (next) => {\n\t\t\tconst data = String(next)\n\t\t\tif (text.nodeValue !== data) text.nodeValue = data\n\t\t})\n\t\treturn\n\t}\n\tif (import.meta.env.DEV && (!(`type` in value) || !(`props` in value)))\n\t\tthrow new Error(`spa: invalid child`)\n\tconst vnode = value as SpaElement\n\tconst props = instanceProps(() => (source() as SpaElement).props, initialKey)\n\tif (!vnode.type || vnode.type === Fragment) {\n\t\tmount(() => props[`children`], parent, before, owner, namespace, cursor)\n\t\treturn\n\t}\n\tif (typeof vnode.type === `function`) {\n\t\tconst childOwner = createScope(owner)\n\t\tconst output = within(childOwner, () =>\n\t\t\tuntrack(() => (vnode.type as Function)(props)),\n\t\t)\n\t\tmount(trackKeys(output), parent, before, childOwner, namespace, cursor)\n\t\treturn\n\t}\n\tconst ns = vnode.type === `svg` ? SVG : namespace\n\tconst element = take(\n\t\tparent.ownerDocument!.createElementNS(ns, vnode.type),\n\t\tparent,\n\t\tbefore,\n\t\towner,\n\t\tcursor,\n\t) as Element\n\tif (ns === HTML && /^(input|textarea|select)$/.test(vnode.type))\n\t\tbindForm(element as HTMLInputElement, props, owner)\n\tif (ns === HTML && (props[`autoFocus`] || props[`autofocus`])) {\n\t\towner._root._mounts!.push(() => {\n\t\t\tif (!owner._dead) (element as HTMLElement).focus()\n\t\t})\n\t}\n\tif (vnode.type === `astro-slot`) {\n\t\tif (!cursor) element.innerHTML = props[`innerHTML`] ?? ``\n\t} else if (ns === HTML && /^(textarea|title|style|script)$/.test(vnode.type)) {\n\t\tobserve(\n\t\t\towner,\n\t\t\t() =>\n\t\t\t\tplain(\n\t\t\t\t\tvnode.type === `textarea`\n\t\t\t\t\t\t? (props[`value`] ?? props[`children`])\n\t\t\t\t\t\t: props[`children`],\n\t\t\t\t),\n\t\t\t(text) => {\n\t\t\t\tif (element.textContent !== text) element.textContent = text\n\t\t\t},\n\t\t)\n\t} else {\n\t\tconst children = cursor\n\t\t\t? { node: element.firstChild, report: cursor.report }\n\t\t\t: undefined\n\t\tif (\n\t\t\t!/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/.test(\n\t\t\t\tvnode.type,\n\t\t\t) ||\n\t\t\tns !== HTML\n\t\t)\n\t\t\tmount(\n\t\t\t\t() => props[`children`],\n\t\t\t\telement,\n\t\t\t\tnull,\n\t\t\t\towner,\n\t\t\t\tvnode.type === `foreignObject` ? HTML : ns,\n\t\t\t\tchildren,\n\t\t\t)\n\t\tfinish(children)\n\t}\n\tlet previous: Record<string, any> = {}\n\tconst nativeProps = capabilityProps(\n\t\towner,\n\t\t{ kind: `dom`, node: element },\n\t\t() => ({ ...props }),\n\t\t(next) => {\n\t\t\tconst previousStyle =\n\t\t\t\tprevious[`style`] !== next[`style`]\n\t\t\t\t\t? (element.getAttribute(`style`) ?? ``)\n\t\t\t\t\t: undefined\n\t\t\tfor (const key in { ...previous, ...next })\n\t\t\t\tif (\n\t\t\t\t\t!Object.is(previous[key], next[key]) ||\n\t\t\t\t\ttypeof next[key] === `object`\n\t\t\t\t) {\n\t\t\t\t\tproperty(element, key, next[key], previous[key])\n\t\t\t\t\tprevious[key] = next[key]\n\t\t\t\t}\n\t\t\tprevious = next\n\t\t\treturn previousStyle\n\t\t},\n\t)\n\towner._cleanups.add(() => {\n\t\tfor (const key in previous)\n\t\t\tif (key.startsWith(`on`)) property(element, key, null, previous[key])\n\t})\n\tobserve(owner, () => ({ ...props }), nativeProps)\n\tconst ref = untrack(() => props[`ref`])\n\tif (ref) {\n\t\towner._root._mounts!.unshift(() => {\n\t\t\tif (!owner._dead) {\n\t\t\t\towner._cleanups.add(() => ref(null))\n\t\t\t\twithin(owner, () => ref(element))\n\t\t\t}\n\t\t})\n\t}\n}\n\nexport interface SpaRoot {\n\tdispose(): void\n\tflush(): void\n}\nfunction start(\n\tsetup: () => Children,\n\thost: Element,\n\toptions: RootOptions,\n\thydrating: boolean,\n\tbefore: Node | null = null,\n): SpaRoot {\n\tlet reported = false\n\tconst cursor: Cursor | undefined = hydrating\n\t\t? {\n\t\t\t\tnode: host.firstChild,\n\t\t\t\treport(expected, found) {\n\t\t\t\t\tif (!reported) {\n\t\t\t\t\t\treported = true\n\t\t\t\t\t\t// eslint-disable-next-line no-console -- Recoverable degradation must remain human-readable in production.\n\t\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t\t`spa: hydration mismatch. Repairing server HTML to match the browser view; replaced nodes may lose focus or unsaved input.`,\n\t\t\t\t\t\t\t{ host, expected, found },\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}\n\t\t: undefined\n\tconst marker = cursor?.node\n\tconst prefix =\n\t\tmarker?.nodeType === 8 && marker.nodeValue?.startsWith(`w:`)\n\t\t\t? marker.nodeValue.slice(2)\n\t\t\t: undefined\n\tconst root = createRoot(options)\n\troot._host = host\n\tif (prefix !== undefined && options.idPrefix === undefined)\n\t\troot._prefix = prefix\n\tif (import.meta.env.DEV) trackRoot(root)\n\ttry {\n\t\tcomment(`w:${root._prefix}`, host, before, root, cursor)\n\t\twithin(root, () => {\n\t\t\tmount(\n\t\t\t\ttrackKeys(untrack(setup)),\n\t\t\t\thost,\n\t\t\t\tbefore,\n\t\t\t\troot,\n\t\t\t\thost.namespaceURI === SVG ? SVG : HTML,\n\t\t\t\tcursor,\n\t\t\t)\n\t\t})\n\t\tcomment(`/w`, host, before, root, cursor)\n\t\tfinish(cursor)\n\t\troot.flush()\n\t} catch (error) {\n\t\tfail(root, error)\n\t}\n\treturn {\n\t\tdispose: () => {\n\t\t\tdispose(root)\n\t\t},\n\t\tflush: root.flush,\n\t}\n}\nexport function render(\n\tsetup: () => Children,\n\thost: Element,\n\toptions: RootOptions = {},\n): SpaRoot {\n\tif (import.meta.env.DEV)\n\t\treturn hotRoot(\n\t\t\t(next, before) => start(setup, host, next, false, before),\n\t\t\toptions,\n\t\t\thost,\n\t\t)\n\treturn start(setup, host, options, false)\n}\nexport function hydrate(\n\tsetup: () => Children,\n\thost: Element,\n\toptions: RootOptions = {},\n): SpaRoot {\n\tif (import.meta.env.DEV) {\n\t\tlet initial = true\n\t\treturn hotRoot(\n\t\t\t(next, before) => {\n\t\t\t\tconst current = start(setup, host, next, initial, before)\n\t\t\t\tinitial = false\n\t\t\t\treturn current\n\t\t\t},\n\t\t\toptions,\n\t\t\thost,\n\t\t)\n\t}\n\treturn start(setup, host, options, true)\n}\n"],"mappings":";;;;AAIA,MAAM,0BAAU,IAAI,QAAsC;AAC1D,MAAM,2BAAW,IAAI,QAA6B;AAClD,MAAM,SAAS;CAAC;CAAS;CAAU;AAAO;AAC1C,MAAM,aAAa,CAAC;;AAGpB,SAAgB,cAAc,SAAuC;CACpE,IAAI,UAAU,QAAQ,IAAI,OAAO;CACjC,IAAI,CAAC,SAAS;EACb,WAAW,UAAU;GACpB,MAAM,SAAS,MAAM;GACrB,MAAM,UACL,QAAQ,cAAc,cACrB,QAAQ,cAAc,WACtB,CAAC,0BAA0B,KAAK,OAAO,IAAI;GAC7C,IAAI,MAAM,UAAU,UAAU,UAAU,WACvC,QAAQ,KAAK,MAAM,eAAe,KAAK;EACzC;EACA,QAAQ,IAAI,SAAS,OAAO;CAC7B;CACA,OAAO;AACR;AAEA,SAAgB,aAAa,SAAkB,OAA8B;CAC5E,IACC,QAAQ,cAAc,WACtB,QAAQ,SAAS,YACjB,OAAO,UAAU,YACjB,QAAQ,UAAU,MAClB,OAAO,QAAQ,KAAK,MAAM,OAE1B;CACD,IAAI,QAAQ,UAAU,OAAO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M,MAAM;EACxC,OAAO,MAAM;EACb,KAAK,MAAM;CACZ,SAAS,OAAO;EACf,KAAK,MAAM,KAAK;CACjB;CACA,OAAO;EACN,eAAe;GACd,QAAQ,IAAI;EACb;EACA,OAAO,KAAK;CACb;AACD;AACA,SAAgB,OACf,OACA,MACA,UAAuB,CAAC,GACd;CAOV,OAAO,MAAM,OAAO,MAAM,SAAS,KAAK;AACzC;AACA,SAAgB,QACf,OACA,MACA,UAAuB,CAAC,GACd;CAaV,OAAO,MAAM,OAAO,MAAM,SAAS,IAAI;AACxC"}
@@ -1 +1 @@
1
- {"version":3,"file":"floating.js","names":[],"sources":["../src/floating.ts"],"sourcesContent":["import type {\n\tAutoUpdateOptions,\n\tMiddleware,\n\tPlacement,\n\tReferenceElement,\n\tStrategy,\n} from \"@floating-ui/dom\"\nimport { autoUpdate, computePosition } from \"@floating-ui/dom\"\n\nimport type {\n\tCapability,\n\tCapabilityBinding,\n\tCapabilityTarget,\n} from \"./capabilities.ts\"\nimport type { Scope } from \"./core.ts\"\nimport { onMount, reportScopeError, within } from \"./core.ts\"\n\nexport interface FloatingAttributes<Kind extends string = `dom`> {\n\t[`floating:reference`]?: Kind extends `dom` ? ReferenceElement | null : never\n\t[`floating:placement`]?: Kind extends `dom` ? Placement : never\n\t[`floating:strategy`]?: Kind extends `dom` ? Strategy : never\n\t[`floating:middleware`]?: Kind extends `dom` ? readonly Middleware[] : never\n\t[`floating:enabled`]?: Kind extends `dom` ? boolean : never\n\t[`floating:autoUpdate`]?: Kind extends `dom`\n\t\t? boolean | AutoUpdateOptions\n\t\t: never\n}\n\n// eslint-disable-next-line quotes -- TypeScript module augmentation requires a string literal.\ndeclare module \"@atom.io/spa/jsx-runtime\" {\n\t// oxlint-disable-next-line typescript/no-empty-interface -- Declaration merging supplies optional floating attributes.\n\tinterface CapabilityAttributes<\n\t\tKind extends string,\n\t> extends FloatingAttributes<Kind> {}\n}\n\ninterface FloatingProps {\n\treference?: ReferenceElement | null\n\tplacement?: Placement\n\tstrategy?: Strategy\n\tmiddleware?: readonly Middleware[]\n\tenabled?: boolean\n\tautoUpdate?: boolean | AutoUpdateOptions\n}\nconst allowed = new Set([\n\t`reference`,\n\t`placement`,\n\t`strategy`,\n\t`middleware`,\n\t`enabled`,\n\t`autoUpdate`,\n])\nconst observerKeys = [\n\t`ancestorScroll`,\n\t`ancestorResize`,\n\t`elementResize`,\n\t`layoutShift`,\n\t`animationFrame`,\n] as const\nconst ownedStyles = [\n\t`position`,\n\t`left`,\n\t`top`,\n\t`translate`,\n\t`visibility`,\n] as const\n\nfunction attach(target: CapabilityTarget, scope?: Scope): CapabilityBinding {\n\tconst element = target.node as HTMLElement\n\tif (\n\t\ttarget.kind !== `dom` ||\n\t\telement?.namespaceURI !== `http://www.w3.org/1999/xhtml`\n\t)\n\t\tthrow new Error(`spa/floating: floating elements must be HTML elements`)\n\tlet props: FloatingProps = {}\n\tlet dead = false\n\tlet mounted = false\n\tlet generation = 0\n\tlet request = 0\n\tlet stop: (() => void) | undefined\n\tlet reference: ReferenceElement | undefined\n\tlet observing: boolean | AutoUpdateOptions | undefined\n\tlet original: Map<string, { value: string; priority: string }> | undefined\n\tlet positioned = false\n\tlet translation = ``\n\n\tconst restore = () => {\n\t\tif (!original) return\n\t\tfor (const [key, style] of original) {\n\t\t\tif (style.value)\n\t\t\t\telement.style.setProperty(key, style.value, style.priority)\n\t\t\telse element.style.removeProperty(key)\n\t\t}\n\t\toriginal = undefined\n\t\tpositioned = false\n\t\ttranslation = ``\n\t}\n\tconst disconnect = () => {\n\t\t++generation\n\t\tstop?.()\n\t\tstop = undefined\n\t\treference = undefined\n\t}\n\tconst report = (error: unknown) => {\n\t\tif (!scope) {\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tthrow error\n\t\t\t})\n\t\t\treturn\n\t\t}\n\t\treportScopeError(scope, error)\n\t}\n\tconst updatePosition = () => {\n\t\tconst anchor = reference\n\t\tif (dead || !anchor) return\n\t\tconst currentGeneration = generation\n\t\tconst currentRequest = ++request\n\t\tvoid computePosition(anchor, element, {\n\t\t\tplacement: props.placement ?? `bottom`,\n\t\t\tstrategy: props.strategy ?? `absolute`,\n\t\t\tmiddleware: props.middleware ? [...props.middleware] : [],\n\t\t}).then(\n\t\t\t({ x, y }) => {\n\t\t\t\tif (\n\t\t\t\t\tdead ||\n\t\t\t\t\tgeneration !== currentGeneration ||\n\t\t\t\t\tcurrentRequest !== request\n\t\t\t\t)\n\t\t\t\t\treturn\n\t\t\t\ttranslation = `${x}px ${y}px`\n\t\t\t\telement.style.setProperty(`translate`, translation)\n\t\t\t\tif (!positioned) {\n\t\t\t\t\tpositioned = true\n\t\t\t\t\tconst visibility = original!.get(`visibility`)!\n\t\t\t\t\tif (visibility.value)\n\t\t\t\t\t\telement.style.setProperty(\n\t\t\t\t\t\t\t`visibility`,\n\t\t\t\t\t\t\tvisibility.value,\n\t\t\t\t\t\t\tvisibility.priority,\n\t\t\t\t\t\t)\n\t\t\t\t\telse element.style.removeProperty(`visibility`)\n\t\t\t\t}\n\t\t\t},\n\t\t\t(error: unknown) => {\n\t\t\t\tif (\n\t\t\t\t\t!dead &&\n\t\t\t\t\tgeneration === currentGeneration &&\n\t\t\t\t\tcurrentRequest === request\n\t\t\t\t)\n\t\t\t\t\treport(error)\n\t\t\t},\n\t\t)\n\t}\n\tconst connect = () => {\n\t\tif (dead || !mounted) return\n\t\tconst nextReference =\n\t\t\tprops.enabled === false ? undefined : (props.reference ?? undefined)\n\t\tconst nextObserving = props.autoUpdate ?? true\n\t\tconst optionsChanged =\n\t\t\ttypeof nextObserving !== typeof observing ||\n\t\t\t(typeof nextObserving === `object` && typeof observing === `object`\n\t\t\t\t? observerKeys.some(\n\t\t\t\t\t\t(key) =>\n\t\t\t\t\t\t\tnextObserving[key] !== (observing as AutoUpdateOptions)[key],\n\t\t\t\t\t)\n\t\t\t\t: nextObserving !== observing)\n\t\tconst reconnect = nextReference !== reference || optionsChanged\n\t\tif (reconnect) disconnect()\n\t\tif (!nextReference) {\n\t\t\trestore()\n\t\t\treturn\n\t\t}\n\t\toriginal ??= new Map(\n\t\t\townedStyles.map((key) => [\n\t\t\t\tkey,\n\t\t\t\t{\n\t\t\t\t\tvalue: element.style.getPropertyValue(key),\n\t\t\t\t\tpriority: element.style.getPropertyPriority(key),\n\t\t\t\t},\n\t\t\t]),\n\t\t)\n\t\telement.style.setProperty(`position`, props.strategy ?? `absolute`)\n\t\telement.style.setProperty(`left`, `0px`)\n\t\telement.style.setProperty(`top`, `0px`)\n\t\tif (positioned) element.style.setProperty(`translate`, translation)\n\t\telse element.style.setProperty(`visibility`, `hidden`, `important`)\n\t\treference = nextReference\n\t\tobserving =\n\t\t\ttypeof nextObserving === `object` ? { ...nextObserving } : nextObserving\n\t\tif (reconnect && nextObserving !== false) {\n\t\t\tstop = autoUpdate(\n\t\t\t\tnextReference,\n\t\t\t\telement,\n\t\t\t\tupdatePosition,\n\t\t\t\ttypeof nextObserving === `object` ? nextObserving : undefined,\n\t\t\t)\n\t\t} else updatePosition()\n\t}\n\tconst mount = () => {\n\t\tif (dead) return\n\t\tmounted = true\n\t\tconnect()\n\t}\n\tif (scope)\n\t\twithin(scope, () => {\n\t\t\tonMount(mount)\n\t\t})\n\telse queueMicrotask(mount)\n\treturn {\n\t\tupdate(next) {\n\t\t\tif (dead) return\n\t\t\tfor (const key of Object.keys(next))\n\t\t\t\tif (!allowed.has(key))\n\t\t\t\t\tthrow new Error(`spa/floating: unknown property floating:${key}`)\n\t\t\tprops = next\n\t\t\tconnect()\n\t\t},\n\t\tdispose() {\n\t\t\tif (dead) return\n\t\t\tdead = true\n\t\t\tdisconnect()\n\t\t\trestore()\n\t\t},\n\t}\n}\n\n/** Position HTML overlays using CSS translate, leaving transform available to Motion. */\nexport function floatingCapability(): Capability {\n\treturn { namespace: `floating`, attach }\n}\n"],"mappings":";;;AA4CA,MAAM,0BAAU,IAAI,IAAI;CACvB;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,MAAM,eAA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,eAAe;CACvB;CACA,MAAM,cAAc;EACnB,IAAI,MAAM;EACV,UAAU;EACV,QAAQ;CACT;CACA,IAAI,OACH,OAAO,aAAa;EACnB,QAAQ,KAAK;CACd,CAAC;MACG,eAAe,KAAK;CACzB,OAAO;EACN,OAAO,MAAM;GACZ,IAAI,MAAM;GACV,KAAK,MAAM,OAAO,OAAO,KAAK,IAAI,GACjC,IAAI,CAAC,QAAQ,IAAI,GAAG,GACnB,MAAM,IAAI,MAAM,2CAA2C,KAAK;GAClE,QAAQ;GACR,QAAQ;EACT;EACA,UAAU;GACT,IAAI,MAAM;GACV,OAAO;GACP,WAAW;GACX,QAAQ;EACT;CACD;AACD;;AAGA,SAAgB,qBAAiC;CAChD,OAAO;EAAE,WAAW;EAAY;CAAO;AACxC"}
1
+ {"version":3,"file":"floating.js","names":[],"sources":["../src/floating.ts"],"sourcesContent":["import type {\n\tAutoUpdateOptions,\n\tMiddleware,\n\tPlacement,\n\tReferenceElement,\n\tStrategy,\n} from \"@floating-ui/dom\"\nimport { autoUpdate, computePosition } from \"@floating-ui/dom\"\n\nimport type {\n\tCapability,\n\tCapabilityBinding,\n\tCapabilityTarget,\n} from \"./capabilities.ts\"\nimport type { Scope } from \"./core.ts\"\nimport { onMount, reportScopeError, within } from \"./core.ts\"\n\nexport interface FloatingAttributes<Kind extends string = `dom`> {\n\t[`floating:reference`]?: Kind extends `dom` ? ReferenceElement | null : never\n\t[`floating:placement`]?: Kind extends `dom` ? Placement : never\n\t[`floating:strategy`]?: Kind extends `dom` ? Strategy : never\n\t[`floating:middleware`]?: Kind extends `dom` ? readonly Middleware[] : never\n\t[`floating:enabled`]?: Kind extends `dom` ? boolean : never\n\t[`floating:autoUpdate`]?: Kind extends `dom`\n\t\t? boolean | AutoUpdateOptions\n\t\t: never\n}\n\n// eslint-disable-next-line quotes -- TypeScript module augmentation requires a string literal.\ndeclare module \"@atom.io/spa/jsx-runtime\" {\n\t// oxlint-disable-next-line typescript/no-empty-interface -- Declaration merging supplies optional floating attributes.\n\tinterface CapabilityAttributes<\n\t\tKind extends string,\n\t> extends FloatingAttributes<Kind> {}\n}\n\ninterface FloatingProps {\n\treference?: ReferenceElement | null\n\tplacement?: Placement\n\tstrategy?: Strategy\n\tmiddleware?: readonly Middleware[]\n\tenabled?: boolean\n\tautoUpdate?: boolean | AutoUpdateOptions\n}\nconst allowed = new Set([\n\t`reference`,\n\t`placement`,\n\t`strategy`,\n\t`middleware`,\n\t`enabled`,\n\t`autoUpdate`,\n])\nconst observerKeys = [\n\t`ancestorScroll`,\n\t`ancestorResize`,\n\t`elementResize`,\n\t`layoutShift`,\n\t`animationFrame`,\n] as const\nconst ownedStyles = [\n\t`position`,\n\t`left`,\n\t`top`,\n\t`translate`,\n\t`visibility`,\n] as const\n\nfunction attach(target: CapabilityTarget, scope?: Scope): CapabilityBinding {\n\tconst element = target.node as HTMLElement\n\tif (\n\t\ttarget.kind !== `dom` ||\n\t\telement?.namespaceURI !== `http://www.w3.org/1999/xhtml`\n\t)\n\t\tthrow new Error(`spa/floating: floating elements must be HTML elements`)\n\tlet props: FloatingProps = {}\n\tlet dead = false\n\tlet mounted = false\n\tlet generation = 0\n\tlet request = 0\n\tlet stop: (() => void) | undefined\n\tlet reference: ReferenceElement | undefined\n\tlet observing: boolean | AutoUpdateOptions | undefined\n\tlet original: Map<string, { value: string; priority: string }> | undefined\n\tlet positioned = false\n\tlet translation = ``\n\n\tconst restore = () => {\n\t\tif (!original) return\n\t\tfor (const [key, style] of original) {\n\t\t\tif (style.value)\n\t\t\t\telement.style.setProperty(key, style.value, style.priority)\n\t\t\telse element.style.removeProperty(key)\n\t\t}\n\t\toriginal = undefined\n\t\tpositioned = false\n\t\ttranslation = ``\n\t}\n\tconst disconnect = () => {\n\t\t++generation\n\t\tstop?.()\n\t\tstop = undefined\n\t\treference = undefined\n\t}\n\tconst report = (error: unknown) => {\n\t\tif (!scope) {\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tthrow error\n\t\t\t})\n\t\t\treturn\n\t\t}\n\t\treportScopeError(scope, error)\n\t}\n\tconst updatePosition = () => {\n\t\tconst anchor = reference\n\t\tif (dead || !anchor) return\n\t\tconst currentGeneration = generation\n\t\tconst currentRequest = ++request\n\t\tvoid computePosition(anchor, element, {\n\t\t\tplacement: props.placement ?? `bottom`,\n\t\t\tstrategy: props.strategy ?? `absolute`,\n\t\t\tmiddleware: props.middleware ? [...props.middleware] : [],\n\t\t}).then(\n\t\t\t({ x, y }) => {\n\t\t\t\tif (\n\t\t\t\t\tdead ||\n\t\t\t\t\tgeneration !== currentGeneration ||\n\t\t\t\t\tcurrentRequest !== request\n\t\t\t\t)\n\t\t\t\t\treturn\n\t\t\t\ttranslation = `${x}px ${y}px`\n\t\t\t\telement.style.setProperty(`translate`, translation)\n\t\t\t\tif (!positioned) {\n\t\t\t\t\tpositioned = true\n\t\t\t\t\tconst visibility = original!.get(`visibility`)!\n\t\t\t\t\tif (visibility.value)\n\t\t\t\t\t\telement.style.setProperty(\n\t\t\t\t\t\t\t`visibility`,\n\t\t\t\t\t\t\tvisibility.value,\n\t\t\t\t\t\t\tvisibility.priority,\n\t\t\t\t\t\t)\n\t\t\t\t\telse element.style.removeProperty(`visibility`)\n\t\t\t\t}\n\t\t\t},\n\t\t\t(error: unknown) => {\n\t\t\t\tif (\n\t\t\t\t\t!dead &&\n\t\t\t\t\tgeneration === currentGeneration &&\n\t\t\t\t\tcurrentRequest === request\n\t\t\t\t)\n\t\t\t\t\treport(error)\n\t\t\t},\n\t\t)\n\t}\n\tconst connect = () => {\n\t\tif (dead || !mounted) return\n\t\tconst nextReference =\n\t\t\tprops.enabled === false ? undefined : (props.reference ?? undefined)\n\t\tconst nextObserving = props.autoUpdate ?? true\n\t\tconst optionsChanged =\n\t\t\ttypeof nextObserving !== typeof observing ||\n\t\t\t(typeof nextObserving === `object` && typeof observing === `object`\n\t\t\t\t? observerKeys.some(\n\t\t\t\t\t\t(key) =>\n\t\t\t\t\t\t\tnextObserving[key] !== (observing as AutoUpdateOptions)[key],\n\t\t\t\t\t)\n\t\t\t\t: nextObserving !== observing)\n\t\tconst reconnect = nextReference !== reference || optionsChanged\n\t\tif (reconnect) disconnect()\n\t\tif (!nextReference) {\n\t\t\trestore()\n\t\t\treturn\n\t\t}\n\t\toriginal ??= new Map(\n\t\t\townedStyles.map((key) => [\n\t\t\t\tkey,\n\t\t\t\t{\n\t\t\t\t\tvalue: element.style.getPropertyValue(key),\n\t\t\t\t\tpriority: element.style.getPropertyPriority(key),\n\t\t\t\t},\n\t\t\t]),\n\t\t)\n\t\telement.style.setProperty(`position`, props.strategy ?? `absolute`)\n\t\telement.style.setProperty(`left`, `0px`)\n\t\telement.style.setProperty(`top`, `0px`)\n\t\tif (positioned) element.style.setProperty(`translate`, translation)\n\t\telse element.style.setProperty(`visibility`, `hidden`, `important`)\n\t\treference = nextReference\n\t\tobserving =\n\t\t\ttypeof nextObserving === `object` ? { ...nextObserving } : nextObserving\n\t\tif (reconnect && nextObserving !== false) {\n\t\t\tstop = autoUpdate(\n\t\t\t\tnextReference,\n\t\t\t\telement,\n\t\t\t\tupdatePosition,\n\t\t\t\ttypeof nextObserving === `object` ? nextObserving : undefined,\n\t\t\t)\n\t\t} else updatePosition()\n\t}\n\tconst mount = () => {\n\t\tif (dead) return\n\t\tmounted = true\n\t\tconnect()\n\t}\n\tif (scope)\n\t\twithin(scope, () => {\n\t\t\tonMount(mount)\n\t\t})\n\telse queueMicrotask(mount)\n\treturn {\n\t\tupdate(next) {\n\t\t\tif (dead) return\n\t\t\tfor (const key of Object.keys(next))\n\t\t\t\tif (!allowed.has(key))\n\t\t\t\t\tthrow new Error(`spa/floating: unknown property floating:${key}`)\n\t\t\tprops = next\n\t\t\tconnect()\n\t\t},\n\t\tdispose() {\n\t\t\tif (dead) return\n\t\t\tdead = true\n\t\t\tdisconnect()\n\t\t\trestore()\n\t\t},\n\t}\n}\n\n/** Position HTML overlays using CSS translate, leaving transform available to Motion. */\nexport function floatingCapability(): Capability {\n\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E,GAAG,cAAc,IAAI;EAC5D,IAAI,aAAa,kBAAkB,OAClC,OAAO,WACN,eACA,SACA,gBACA,OAAO,kBAAkB,WAAW,gBAAgB,KAAA,CACrD;OACM,eAAe;CACvB;CACA,MAAM,cAAc;EACnB,IAAI,MAAM;EACV,UAAU;EACV,QAAQ;CACT;CACA,IAAI,OACH,OAAO,aAAa;EACnB,QAAQ,KAAK;CACd,CAAC;MACG,eAAe,KAAK;CACzB,OAAO;EACN,OAAO,MAAM;GACZ,IAAI,MAAM;GACV,KAAK,MAAM,OAAO,OAAO,KAAK,IAAI,GACjC,IAAI,CAAC,QAAQ,IAAI,GAAG,GACnB,MAAM,IAAI,MAAM,2CAA2C,KAAK;GAClE,QAAQ;GACR,QAAQ;EACT;EACA,UAAU;GACT,IAAI,MAAM;GACV,OAAO;GACP,WAAW;GACX,QAAQ;EACT;CACD;AACD;;AAGA,SAAgB,qBAAiC;CAChD,OAAO;EAAE,WAAW;EAAY;CAAO;AACxC"}
package/dist/hot.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"hot.d.ts","names":[],"sources":["../src/hot.ts"],"mappings":";UAKU;EACT;EACA;;KAEI,WAAW,SAAS,aAAa,QAAQ,gBAAgB;;wBA4J9C,kBAAkB,UAAU,WAC3C,YACA,cACA,gBAAgB,IACd;wBAGa,QAAQ;wBAGR,UAAU,MAAM;;wBAIhB,cAAc;wBAId,QACf,SAAS,SACT,SAAS,aACT,OAAO,UACL"}
1
+ {"version":3,"file":"hot.d.ts","names":[],"sources":["../src/hot.ts"],"mappings":";UAKU;EACT;EACA;;KAEI,WAAW,SAAS,aAAa,QAAQ,gBAAgB;;wBA6J9C,kBAAkB,UAAU,WAC3C,YACA,cACA,gBAAgB,IACd;wBAGa,QAAQ;wBAGR,UAAU,MAAM;;wBAIhB,cAAc;wBAId,QACf,SAAS,SACT,SAAS,aACT,OAAO,UACL"}