@weasel-js/core 1.15.0 → 1.15.1
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/CHANGELOG.md +84 -0
- package/dist/WeaselProvider.js +4 -5
- package/dist/affordances/composeAffordanceLayer.js +1 -2
- package/dist/affordances/cornerResize.js +4 -5
- package/dist/affordances/hitAffordanceRegions.js +1 -2
- package/dist/affordances/pathAnchors.js +1 -2
- package/dist/affordances/rotateCursor.js +1 -2
- package/dist/affordances/rotationHandle.js +2 -3
- package/dist/animation/behaviors/coast.js +1 -2
- package/dist/animation/behaviors/coastByWrite.js +2 -3
- package/dist/animation/behaviors/coastOnTargets.js +2 -3
- package/dist/animation/behaviors/momentum.js +1 -2
- package/dist/animation/clipTargets.js +1 -2
- package/dist/animation/departures.js +2 -3
- package/dist/animation/poseHelpers.js +2 -3
- package/dist/animation/poseTarget.js +2 -3
- package/dist/animation/poseTransition.js +1 -2
- package/dist/animation/reflow.js +2 -3
- package/dist/animation/rewind.js +1 -2
- package/dist/animation/rig/bindRig.js +2 -3
- package/dist/animation/rig/rigNode.js +1 -2
- package/dist/animation/rig/rigSeat.js +1 -2
- package/dist/animation/rig/skinBinding.js +1 -2
- package/dist/animation/rig/useRig.js +2 -3
- package/dist/animation/wrappers/animateLifecycle.js +1 -2
- package/dist/animation/wrappers/animateOnSetPose.js +1 -2
- package/dist/animation/wrappers/instantPose.js +1 -2
- package/dist/animation/writtenPoseTarget.js +1 -2
- package/dist/barrel/interactions.js +2 -1
- package/dist/barrel/routing.js +2 -2
- package/dist/barrel/scene.js +2 -2
- package/dist/canvas/Canvas.js +5 -6
- package/dist/canvas/CanvasView.js +6 -7
- package/dist/canvas/CursorCoordsHud.js +2 -3
- package/dist/canvas/DrawCanvas.js +3 -4
- package/dist/canvas/GestureReason.js +1 -2
- package/dist/canvas/GestureReason.module.js +1 -2
- package/dist/canvas/LeanSceneCanvas.js +2 -3
- package/dist/canvas/ModalityHud.js +2 -3
- package/dist/canvas/NodeShape.js +3 -4
- package/dist/canvas/PickHud.js +2 -3
- package/dist/canvas/SceneCanvas/ActionsProviderIfRoot.js +1 -2
- package/dist/canvas/SceneCanvas/CanvasKitProviders.js +3 -4
- package/dist/canvas/SceneCanvas/DepRegistryProviderIfRoot.js +1 -2
- package/dist/canvas/SceneCanvas/DevHuds.js +1 -2
- package/dist/canvas/SceneCanvas/PointerProviderIfRoot.js +1 -2
- package/dist/canvas/SceneCanvas/SceneCanvasInput.js +4 -5
- package/dist/canvas/SceneCanvas/SurfaceDeclarations.js +1 -2
- package/dist/canvas/SceneCanvas/brushOverlay.js +1 -2
- package/dist/canvas/SceneCanvas/builtinToolSets.js +1 -2
- package/dist/canvas/SceneCanvas/canvasPassThrough.js +1 -2
- package/dist/canvas/SceneCanvas/contributionFrameHooks.js +1 -2
- package/dist/canvas/SceneCanvas/coordTrace.js +1 -2
- package/dist/canvas/SceneCanvas/defaultNodeProperties.js +3 -4
- package/dist/canvas/SceneCanvas/defaultNodeRouting.js +1 -2
- package/dist/canvas/SceneCanvas/defaultTextEditor.js +4 -5
- package/dist/canvas/SceneCanvas/describePresets.js +1 -2
- package/dist/canvas/SceneCanvas/dispatcherGestureBounds.js +1 -2
- package/dist/canvas/SceneCanvas/features.js +1 -2
- package/dist/canvas/SceneCanvas/insertPreviewCommands.js +1 -2
- package/dist/canvas/SceneCanvas/mergeLayers.js +1 -2
- package/dist/canvas/SceneCanvas/namedPresets.js +5 -6
- package/dist/canvas/SceneCanvas/poseGeometry.js +1 -2
- package/dist/canvas/SceneCanvas/poseRegistrars.js +1 -2
- package/dist/canvas/SceneCanvas/presets/arrange.js +2 -3
- package/dist/canvas/SceneCanvas/presets/baseline.js +1 -2
- package/dist/canvas/SceneCanvas/presets/chrome.js +1 -2
- package/dist/canvas/SceneCanvas/presets/composites.js +1 -2
- package/dist/canvas/SceneCanvas/presets/edit.js +4 -5
- package/dist/canvas/SceneCanvas/presets/ingest.js +1 -2
- package/dist/canvas/SceneCanvas/presets/paths.js +3 -4
- package/dist/canvas/SceneCanvas/presets/select.js +1 -2
- package/dist/canvas/SceneCanvas/presets/toolDriven.js +2 -3
- package/dist/canvas/SceneCanvas/presets/tools.js +1 -2
- package/dist/canvas/SceneCanvas/presets/transform.js +2 -3
- package/dist/canvas/SceneCanvas/presets/view.js +2 -3
- package/dist/canvas/SceneCanvas/props.js +1 -2
- package/dist/canvas/SceneCanvas/scenePointQuery.js +2 -3
- package/dist/canvas/SceneCanvas/shapeGeneratorProperties.js +1 -2
- package/dist/canvas/SceneCanvas/toolRegistry.js +2 -3
- package/dist/canvas/SceneCanvas/useActionTunings.js +1 -2
- package/dist/canvas/SceneCanvas/useActionsPropResolver.js +1 -2
- package/dist/canvas/SceneCanvas/useBakedScene.js +2 -3
- package/dist/canvas/SceneCanvas/useBuiltinShapeTools.js +7 -8
- package/dist/canvas/SceneCanvas/useBuiltinTools.js +2 -3
- package/dist/canvas/SceneCanvas/useCanvasCamera.js +2 -3
- package/dist/canvas/SceneCanvas/useCanvasDevtoolsRoot.js +1 -2
- package/dist/canvas/SceneCanvas/useCanvasDispatcher.js +1 -2
- package/dist/canvas/SceneCanvas/useCanvasSelection.js +8 -6
- package/dist/canvas/SceneCanvas/useCanvasSelection.js.map +1 -1
- package/dist/canvas/SceneCanvas/useCanvasTools.js +2 -3
- package/dist/canvas/SceneCanvas/useChromeAffordances.js +2 -3
- package/dist/canvas/SceneCanvas/useContributionRoles.js +1 -2
- package/dist/canvas/SceneCanvas/useDepartureGhostLayer.js +4 -5
- package/dist/canvas/SceneCanvas/useDispatcherOverlayLayer.js +2 -3
- package/dist/canvas/SceneCanvas/useHeldModifiers.js +1 -2
- package/dist/canvas/SceneCanvas/useMagnificationCheck.js +41 -0
- package/dist/canvas/SceneCanvas/useMagnificationCheck.js.map +1 -0
- package/dist/canvas/SceneCanvas/useNodeAtPoint.js +1 -2
- package/dist/canvas/SceneCanvas/useNodeKinds.js +2 -3
- package/dist/canvas/SceneCanvas/usePreviewGhostLayer.js +10 -11
- package/dist/canvas/SceneCanvas/useSceneCanvasHandle.js +1 -2
- package/dist/canvas/SceneCanvas/useSceneCanvasLayers.js +6 -7
- package/dist/canvas/SceneCanvas/useSceneCanvasPathEdit.js +1 -2
- package/dist/canvas/SceneCanvas/useSceneCanvasTools.js +1 -2
- package/dist/canvas/SceneCanvas/useSceneChrome.js +5 -6
- package/dist/canvas/SceneCanvas/useSceneGestureDispatcher.js +6 -7
- package/dist/canvas/SceneCanvas/useScenePicking.js +5 -6
- package/dist/canvas/SceneCanvas/useSceneRedrawSources.js +1 -2
- package/dist/canvas/SceneCanvas/useSceneSelectTool.js +7 -8
- package/dist/canvas/SceneCanvas/useSceneSlotLayers.js +2 -3
- package/dist/canvas/SceneCanvas/useSceneStandardActions.js +26 -18
- package/dist/canvas/SceneCanvas/useSceneStandardActions.js.map +1 -1
- package/dist/canvas/SceneCanvas/useSelectionOverlayLayer.js +2 -3
- package/dist/canvas/SceneCanvas/useSurfaceRouting.js +1 -2
- package/dist/canvas/SceneCanvas/useSurfaceViewInputs.js +1 -2
- package/dist/canvas/SceneCanvas/useToolKeybindings.js +1 -2
- package/dist/canvas/SceneCanvas/useViewportActions.js +3 -4
- package/dist/canvas/SceneCanvas/worldPointAt.js +1 -2
- package/dist/canvas/SceneCanvas.js +18 -17
- package/dist/canvas/SceneCanvas.js.map +1 -1
- package/dist/canvas/SceneViewCanvas.js +2 -3
- package/dist/canvas/SurfaceCanvas.js +1 -2
- package/dist/canvas/ViewMarker.js +1 -2
- package/dist/canvas/accentColor.js +1 -2
- package/dist/canvas/adapterDerivedPath.js +2 -3
- package/dist/canvas/adapterPickSource.js +1 -2
- package/dist/canvas/affordanceAt.js +2 -3
- package/dist/canvas/buildSceneLayer.js +4 -5
- package/dist/canvas/buildSceneTree.js +4 -5
- package/dist/canvas/canvasRenderer.js +1 -2
- package/dist/canvas/colorOverrides.js +1 -2
- package/dist/canvas/contextAttributes.js +1 -2
- package/dist/canvas/copiesAbove.js +1 -2
- package/dist/canvas/defaultDrawOne.js +1 -2
- package/dist/canvas/deps/areaSelect.js +5 -3
- package/dist/canvas/deps/areaSelect.js.map +1 -1
- package/dist/canvas/deps/booleans.js +5 -6
- package/dist/canvas/deps/changes.js +1 -2
- package/dist/canvas/deps/chromeRules.js +1 -2
- package/dist/canvas/deps/debug.js +1 -2
- package/dist/canvas/deps/dispatchSources.js +1 -2
- package/dist/canvas/deps/dispatcher.js +1 -2
- package/dist/canvas/deps/editAnchors.js +3 -4
- package/dist/canvas/deps/enteredGroup.js +1 -2
- package/dist/canvas/deps/geometryProjection.js +1 -2
- package/dist/canvas/deps/hitTestArea.js +4 -5
- package/dist/canvas/deps/ingestion.js +1 -2
- package/dist/canvas/deps/insert.js +3 -4
- package/dist/canvas/deps/insertSite.js +3 -4
- package/dist/canvas/deps/kitSettings.js +1 -2
- package/dist/canvas/deps/lassoSelect.js +5 -3
- package/dist/canvas/deps/lassoSelect.js.map +1 -1
- package/dist/canvas/deps/layout.js +1 -2
- package/dist/canvas/deps/modeDefaultTool.js +1 -2
- package/dist/canvas/deps/nodeAtPoint.js +1 -2
- package/dist/canvas/deps/pathEditCommits.js +4 -5
- package/dist/canvas/deps/pathLeaf.js +1 -2
- package/dist/canvas/deps/pathLeafDeps.js +2 -3
- package/dist/canvas/deps/poseDescriptor.js +1 -2
- package/dist/canvas/deps/previewPaths.js +1 -2
- package/dist/canvas/deps/resizePolicy.js +1 -2
- package/dist/canvas/deps/selectionSnapshot.js +1 -2
- package/dist/canvas/deps/slice.js +5 -6
- package/dist/canvas/deps/snap.js +3 -4
- package/dist/canvas/deps/surface.js +1 -2
- package/dist/canvas/deps/textEdit.js +1 -2
- package/dist/canvas/deps/transformFollowers.js +1 -2
- package/dist/canvas/deps/view.js +1 -2
- package/dist/canvas/derivedPath.js +6 -7
- package/dist/canvas/doubleClickTarget.js +1 -2
- package/dist/canvas/drawEnvelope.js +1 -2
- package/dist/canvas/drawnBounds.js +4 -5
- package/dist/canvas/getNodeAtPoint.js +1 -2
- package/dist/canvas/hostAnchor.js +1 -2
- package/dist/canvas/hud.module.js +1 -2
- package/dist/canvas/inheritedPaints.js +1 -2
- package/dist/canvas/insertPreviewExtent.js +1 -2
- package/dist/canvas/kitRequirements.js +1 -2
- package/dist/canvas/layerHover.js +1 -2
- package/dist/canvas/layerOrder.js +1 -2
- package/dist/canvas/layerSlots.js +1 -2
- package/dist/canvas/mountedCanvases.js +1 -2
- package/dist/canvas/nodeShapes/derivedPainter.js +2 -3
- package/dist/canvas/nodeShapes/imagePainter.js +1 -2
- package/dist/canvas/nodeShapes/measurePainter.js +2 -3
- package/dist/canvas/nodeShapes/memo.js +1 -2
- package/dist/canvas/nodeShapes/nodePaint.js +1 -2
- package/dist/canvas/nodeShapes/pathPainter.js +3 -4
- package/dist/canvas/nodeShapes/poseBox.js +1 -2
- package/dist/canvas/nodeShapes/rectFallbackPainter.js +1 -2
- package/dist/canvas/nodeShapes/shapePainter.js +2 -3
- package/dist/canvas/nodeShapes/strokedBounds.js +1 -2
- package/dist/canvas/nodeShapes/textPainter.js +1 -2
- package/dist/canvas/overChildren.js +1 -2
- package/dist/canvas/overlayRoleStrokes.js +1 -2
- package/dist/canvas/ownClip.js +1 -2
- package/dist/canvas/paintCull.js +1 -2
- package/dist/canvas/paintedCursorLayer.js +1 -2
- package/dist/canvas/pathOverlay.js +1 -2
- package/dist/canvas/pickIndex/nodeBroadBox.js +3 -4
- package/dist/canvas/pickIndex/scenePickIndex.js +3 -4
- package/dist/canvas/pickReach.js +1 -2
- package/dist/canvas/pickWalk.js +2 -3
- package/dist/canvas/planeClips.js +1 -2
- package/dist/canvas/poseRotation.js +1 -2
- package/dist/canvas/publishPreviews.js +1 -2
- package/dist/canvas/rasterReadback.js +1 -2
- package/dist/canvas/rasterToPng.js +1 -2
- package/dist/canvas/renderDebugSnapshot.js +1 -2
- package/dist/canvas/renderNeeds.js +1 -2
- package/dist/canvas/renderSceneToPixels.js +5 -6
- package/dist/canvas/sceneAdapter.js +37 -27
- package/dist/canvas/sceneAdapter.js.map +1 -1
- package/dist/canvas/sceneClipboard.js +19 -7
- package/dist/canvas/sceneClipboard.js.map +1 -1
- package/dist/canvas/sceneLayerPaint.js +1 -2
- package/dist/canvas/scenePickReads.js +1 -2
- package/dist/canvas/scenePickSource.js +5 -6
- package/dist/canvas/sceneSlotWiring.js +2 -3
- package/dist/canvas/sceneViewRender.js +5 -6
- package/dist/canvas/shownNodes.js +1 -2
- package/dist/canvas/slopsDebugLayer.js +1 -2
- package/dist/canvas/surfaceContribution.js +1 -2
- package/dist/canvas/useCanvasElements.js +1 -2
- package/dist/canvas/useCanvasHandle.js +1 -2
- package/dist/canvas/useCanvasPaint.js +2 -3
- package/dist/canvas/useCanvasRenderer.js +1 -2
- package/dist/canvas/useCanvasSurface.js +1 -2
- package/dist/canvas/useCanvasView.js +2 -3
- package/dist/canvas/useClientToWorld.js +1 -2
- package/dist/canvas/useExtraLayers.js +1 -2
- package/dist/canvas/useFrameLoop.js +1 -2
- package/dist/canvas/useHitObserver.js +1 -2
- package/dist/canvas/useHostAnchor.js +1 -2
- package/dist/canvas/useInFlightBounds.js +6 -6
- package/dist/canvas/useInFlightBounds.js.map +1 -1
- package/dist/canvas/useLateContentRedraw.js +1 -2
- package/dist/canvas/useLayerStack.js +2 -3
- package/dist/canvas/usePaintedCursor.js +1 -2
- package/dist/canvas/useRedrawOn.js +1 -2
- package/dist/canvas/useSceneAdapter.js +1 -2
- package/dist/canvas/useSceneLayerList.js +1 -2
- package/dist/canvas/useSurfaceInput.js +1 -2
- package/dist/canvas/useSurfaceSize.js +1 -2
- package/dist/canvas/useToolCursor.js +1 -2
- package/dist/canvas/useViewAim.js +2 -3
- package/dist/canvas/useViewHelpers.js +5 -4
- package/dist/canvas/useViewHelpers.js.map +1 -1
- package/dist/canvas/useViewLayerGate.js +1 -2
- package/dist/canvas/useViewNesting.js +1 -2
- package/dist/canvas/useViewRegistrySurface.js +1 -2
- package/dist/canvas/viewInputs.js +1 -2
- package/dist/canvas/viewMarkers.js +1 -2
- package/dist/canvas/viewRegistry.js +1 -2
- package/dist/canvas/viewSnap.js +1 -2
- package/dist/canvas/watchElementMove.js +1 -2
- package/dist/canvas/wrapNodeOutput.js +1 -2
- package/dist/core/adapters/testing/rootsTree.js +1 -2
- package/dist/core/applyOps.js +1 -2
- package/dist/core/device/targets.js +1 -2
- package/dist/core/device/useDeviceProfile.js +1 -2
- package/dist/core/device/useTargetBasePx.js +1 -2
- package/dist/core/device/watchDevicePixelRatio.js +1 -2
- package/dist/core/geometry/autoPoseDescriptor.js +2 -3
- package/dist/core/geometry/booleanOfPaths.js +1 -2
- package/dist/core/geometry/inkExtents.js +1 -2
- package/dist/core/geometry/pathPoseDescriptor.js +1 -2
- package/dist/core/geometry/poseDescriptor.js +1 -2
- package/dist/core/geometry/regionHit.js +1 -2
- package/dist/core/geometry/targetFrame.js +1 -2
- package/dist/core/geometry/unionBounds.js +1 -2
- package/dist/core/layers/backgroundFill.js +1 -2
- package/dist/core/layers/children.js +1 -2
- package/dist/core/layers/gateLayer.js +1 -2
- package/dist/core/layers/layerGroup.js +1 -2
- package/dist/core/layers/redrawSource.js +1 -2
- package/dist/core/layers/render.js +1 -2
- package/dist/core/layers/retain.js +1 -2
- package/dist/core/ops/arrange.js +1 -2
- package/dist/core/ops/create.js +2 -3
- package/dist/core/ops/createHistory.js +2 -3
- package/dist/core/ops/delete.js +2 -3
- package/dist/core/ops/nodeFlags.js +1 -2
- package/dist/core/ops/registry.js +1 -2
- package/dist/core/ops/reorder/algorithms.js +1 -2
- package/dist/core/ops/reorder/index.js +1 -2
- package/dist/core/ops/reorder/setChildOrder.js +1 -2
- package/dist/core/ops/reparent.js +1 -2
- package/dist/core/ops/select.js +1 -2
- package/dist/core/ops/setData.js +1 -2
- package/dist/core/ops/setDependsOn.js +1 -2
- package/dist/core/ops/setLayer.js +1 -2
- package/dist/core/ops/setLayout.js +1 -2
- package/dist/core/ops/setPath.js +1 -2
- package/dist/core/ops/setText.js +1 -2
- package/dist/core/ops/slot.js +1 -2
- package/dist/core/ops/transform.js +1 -2
- package/dist/core/ops/writtenBy.js +1 -2
- package/dist/core/pages/fitViewToPage.js +1 -2
- package/dist/core/pages/pageEdits.js +3 -4
- package/dist/core/pages/pages.js +1 -2
- package/dist/core/pages/pages.js.map +1 -1
- package/dist/core/pages/pagesLayer.js +1 -2
- package/dist/core/paint/meshKind.js +1 -2
- package/dist/core/paint/meshKindLazy.js +9 -18
- package/dist/core/paint/meshKindLazy.js.map +1 -1
- package/dist/core/paint/paintKindEntry.js +1 -2
- package/dist/core/paint/paintKinds.js +1 -2
- package/dist/core/paint/registerMesh.js +1 -2
- package/dist/core/scene/NodeProperties.js +1 -2
- package/dist/core/scene/NodeRouting.js +1 -2
- package/dist/core/scene/annotation.js +1 -2
- package/dist/core/scene/appliedLog.js +1 -2
- package/dist/core/scene/arrivalWindow.js +2 -3
- package/dist/core/scene/arrivals.js +1 -2
- package/dist/core/scene/booleanGroup.js +1 -2
- package/dist/core/scene/booleanOfChildren.js +1 -2
- package/dist/core/scene/boundOps.js +1 -2
- package/dist/core/scene/carryDescendants.js +2 -3
- package/dist/core/scene/clipNothing.js +1 -2
- package/dist/core/scene/composeFrame.js +1 -2
- package/dist/core/scene/composePose.js +1 -2
- package/dist/core/scene/declaredFieldSetters.js +1 -2
- package/dist/core/scene/depFrame.js +1 -2
- package/dist/core/scene/depMemo.js +1 -2
- package/dist/core/scene/dependents.js +1 -2
- package/dist/core/scene/derivedParts.js +1 -2
- package/dist/core/scene/derivedPath.js +2 -3
- package/dist/core/scene/docValues.js +1 -2
- package/dist/core/scene/documentOf.js +1 -2
- package/dist/core/scene/editMode.js +1 -2
- package/dist/core/scene/editPass.js +1 -2
- package/dist/core/scene/effectivePose.js +3 -4
- package/dist/core/scene/fieldEdits.js +1 -2
- package/dist/core/scene/fontReads.js +1 -2
- package/dist/core/scene/historyFacade.js +1 -2
- package/dist/core/scene/historyForm.js +1 -2
- package/dist/core/scene/inheritedPaint.js +1 -2
- package/dist/core/scene/kitOps.js +16 -15
- package/dist/core/scene/kitOps.js.map +1 -1
- package/dist/core/scene/kitRegistry.js +2 -3
- package/dist/core/scene/layerOps.js +1 -2
- package/dist/core/scene/layerStack.js +1 -2
- package/dist/core/scene/layoutPass.js +4 -5
- package/dist/core/scene/lockGuard.js +1 -2
- package/dist/core/scene/minSize.js +1 -2
- package/dist/core/scene/nestedHit.js +1 -2
- package/dist/core/scene/nodeAsShown.js +1 -2
- package/dist/core/scene/nodeFlags.js +1 -2
- package/dist/core/scene/nodeFnFields.js +1 -2
- package/dist/core/scene/nodeGates.js +1 -2
- package/dist/core/scene/nodeMemo.js +1 -2
- package/dist/core/scene/nodeStore.js +2 -3
- package/dist/core/scene/notifier.js +1 -2
- package/dist/core/scene/opTable.js +1 -2
- package/dist/core/scene/outerOps.js +1 -2
- package/dist/core/scene/pathEffects/blend.js +1 -2
- package/dist/core/scene/pathEffects/derive.js +2 -3
- package/dist/core/scene/pathEffects/effects.js +1 -2
- package/dist/core/scene/pathEffects/foundHidden.js +1 -2
- package/dist/core/scene/pathEffects/textAlong.js +1 -2
- package/dist/core/scene/pathEffects/textAlongBands.js +1 -2
- package/dist/core/scene/plyStacks.js +1 -2
- package/dist/core/scene/poseFeed.js +1 -2
- package/dist/core/scene/poseHold.js +1 -2
- package/dist/core/scene/poseOverrides.js +1 -2
- package/dist/core/scene/posePlies.js +1 -2
- package/dist/core/scene/poseRemovals.js +1 -2
- package/dist/core/scene/poseSnapshot.js +1 -2
- package/dist/core/scene/poseWrites.js +1 -2
- package/dist/core/scene/reconcileSpecs.js +26 -3
- package/dist/core/scene/reconcileSpecs.js.map +1 -1
- package/dist/core/scene/recorder.js +1 -2
- package/dist/core/scene/renderOrder.js +1 -2
- package/dist/core/scene/sameValue.js +1 -2
- package/dist/core/scene/scene.js +11 -12
- package/dist/core/scene/scene.js.map +1 -1
- package/dist/core/scene/sceneChanges.js +1 -2
- package/dist/core/scene/sceneEdits.js +1 -2
- package/dist/core/scene/sceneJournals.js +1 -2
- package/dist/core/scene/sceneMutators.js +2 -3
- package/dist/core/scene/scenePoseAdapter.js +1 -2
- package/dist/core/scene/sceneRecording.js +1 -2
- package/dist/core/scene/sceneSelection.js +8 -5
- package/dist/core/scene/sceneSelection.js.map +1 -1
- package/dist/core/scene/sceneState.js +3 -4
- package/dist/core/scene/scrollOffsets.js +1 -2
- package/dist/core/scene/serialization.js +2 -3
- package/dist/core/scene/staleReplay.js +1 -2
- package/dist/core/scene/statedFields.js +1 -2
- package/dist/core/scene/strategyView.js +1 -2
- package/dist/core/scene/treeEdits.js +2 -3
- package/dist/core/scene/treeOrder.js +1 -2
- package/dist/core/scene/treeReads.js +1 -2
- package/dist/core/scene/treeShape.js +1 -2
- package/dist/core/scene/types.js +1 -2
- package/dist/core/scene/types.js.map +1 -1
- package/dist/core/scene/unionOfChildren.js +1 -2
- package/dist/core/scene/unitScopes.js +20 -4
- package/dist/core/scene/unitScopes.js.map +1 -1
- package/dist/core/scene/useScene.js +2 -3
- package/dist/core/scene/worldSave.js +2 -3
- package/dist/core/selection/chromeState.js +1 -2
- package/dist/core/selection/outermostSelection.js +56 -0
- package/dist/core/selection/outermostSelection.js.map +1 -0
- package/dist/core/selection/readOnlySelection.js +1 -2
- package/dist/core/selection/selectionTarget.js +1 -2
- package/dist/core/selection/usePublishSceneSelection.js +1 -2
- package/dist/core/selection/useSelection.js +1 -2
- package/dist/core/shapeKinds.js +1 -2
- package/dist/core/stableStringify.js +1 -2
- package/dist/core/stylus/stylus.js +1 -2
- package/dist/core/stylus/usePointerStylus.js +1 -2
- package/dist/core/usePaintKinds.js +1 -2
- package/dist/core/viewport/clampView.js +1 -2
- package/dist/core/viewport/clientToWorld.js +1 -2
- package/dist/core/viewport/createVelocityTracker.js +1 -2
- package/dist/core/viewport/fitToBounds.js +1 -2
- package/dist/core/viewport/fitViewToBounds.js +1 -2
- package/dist/core/viewport/interpolateView.js +1 -2
- package/dist/core/viewport/parallax.js +1 -2
- package/dist/core/viewport/sceneNodeClientRect.js +1 -2
- package/dist/core/viewport/screenSlop.js +1 -2
- package/dist/core/viewport/useAutoCenter.js +1 -2
- package/dist/core/viewport/useCanvasSize.js +1 -2
- package/dist/core/viewport/useDecayLoop.js +1 -2
- package/dist/core/viewport/useNodeOverlayFrame.js +1 -2
- package/dist/core/viewport/useVelocityTracker.js +1 -2
- package/dist/core/viewport/useViewAnimation.js +3 -4
- package/dist/core/viewport/view.js +1 -2
- package/dist/core/viewport/viewTransform.js +1 -2
- package/dist/core/viewport/viewportWorldRect.js +1 -2
- package/dist/core/viewport/wheelHandler.js +1 -2
- package/dist/core/viewport/zoomAt.js +2 -3
- package/dist/core/viewport/zoomBounds.js +1 -2
- package/dist/debug/createDebugOverlayLayer.js +1 -2
- package/dist/debug/createDebugSink.js +1 -2
- package/dist/debug/defaultTheme.js +1 -2
- package/dist/debug/features.js +1 -2
- package/dist/debug/frameStats.js +1 -2
- package/dist/debug/overlayPanels.js +1 -2
- package/dist/debug/parseDebugFlags.js +1 -2
- package/dist/debug/useDebugSink.js +2 -3
- package/dist/{depSchema-ChQPzEkW.d.ts → depSchema-C7a_OMt-.d.ts} +61 -52
- package/dist/devtools/handlers.js +1 -2
- package/dist/devtools/history.js +1 -2
- package/dist/devtools/hook.js +1 -2
- package/dist/devtools/label.js +1 -2
- package/dist/devtools/notices.js +1 -2
- package/dist/devtools/protocol.js +1 -2
- package/dist/devtools/registry.js +1 -2
- package/dist/devtools/root.js +1 -2
- package/dist/devtools/serialize.js +1 -2
- package/dist/devtools/session.js +2 -3
- package/dist/devtools/transport.js +1 -2
- package/dist/devtools/useDevtoolsRoot.js +1 -2
- package/dist/devtools-protocol.d.ts +1 -1
- package/dist/devtools-protocol.js +2 -2
- package/dist/devtools.d.ts +1 -1
- package/dist/devtools.js +1 -2
- package/dist/domains/chrome-caps/buildChromeCtx.js +1 -2
- package/dist/domains/chrome-caps/conditions.js +1 -2
- package/dist/domains/chrome-caps/defaults.js +1 -2
- package/dist/domains/chrome-caps/resolve.js +2 -3
- package/dist/domains/chrome-caps/useChromeCaps.js +1 -2
- package/dist/domains/chrome-caps/useHoverTracking.js +1 -2
- package/dist/domains/ingestion/contentHandlers.js +1 -2
- package/dist/domains/ingestion/ghost.js +2 -3
- package/dist/domains/ingestion/imageHandler.js +1 -2
- package/dist/domains/ingestion/kitHandlers.js +2 -3
- package/dist/domains/ingestion/openFilePicker.js +1 -2
- package/dist/domains/ingestion/placement.js +1 -2
- package/dist/domains/ingestion/svgHandler.js +1 -2
- package/dist/domains/ingestion/textHandler.js +1 -2
- package/dist/domains/ingestion/useCanvasIngestion.js +1 -2
- package/dist/domains/ingestion/weaselJsonHandler.js +2 -3
- package/dist/domains/longPress/longPressFeedback.js +1 -2
- package/dist/domains/measure/actionIds.js +1 -2
- package/dist/domains/measure/measureCommands.js +6 -7
- package/dist/domains/measure/measureContribution.js +3 -4
- package/dist/domains/measure/measureEdits.js +3 -4
- package/dist/domains/measure/measureGestures.js +2 -3
- package/dist/domains/measure/measureHit.js +3 -4
- package/dist/domains/measure/measureLayer.js +3 -4
- package/dist/domains/measure/measurement.js +1 -2
- package/dist/domains/measure/measurements.js +1 -2
- package/dist/domains/modes/modeLayers.js +1 -2
- package/dist/domains/modes/modeTriggers.js +1 -2
- package/dist/domains/pathEffects/effectSources.js +2 -3
- package/dist/domains/pathEffects/index.js +1 -2
- package/dist/domains/pathEffects/readSource.js +3 -4
- package/dist/domains/pathEffects/textItems.js +1 -2
- package/dist/domains/pathEffects/useEffectSourcesLayer.js +3 -4
- package/dist/domains/paths/anchorData.js +1 -2
- package/dist/domains/paths/anchorMarkers.js +1 -2
- package/dist/domains/paths/editablePath.js +3 -4
- package/dist/domains/paths/originProjection.js +1 -2
- package/dist/domains/paths/pathEditExtension.js +1 -2
- package/dist/domains/paths/pathEditState.js +1 -2
- package/dist/domains/paths/pathEditingOverlayLayer.js +2 -3
- package/dist/domains/paths/pathLayer.js +1 -2
- package/dist/domains/paths/pathRepresentation.js +1 -2
- package/dist/domains/paths/pathSnap/glyphs.js +1 -2
- package/dist/domains/paths/pathSnap/pathSnapSource.js +1 -2
- package/dist/domains/paths/pathSnap/sceneIndex.js +1 -2
- package/dist/domains/paths/pathSnap/snapGeometry.js +2 -3
- package/dist/domains/paths/penPreviewLayer.js +1 -2
- package/dist/domains/paths/shapeGenerator.js +1 -2
- package/dist/domains/paths/strokeOutline.js +2 -3
- package/dist/domains/paths/useAnchorFields.js +1 -2
- package/dist/domains/paths/usePathEdit.js +2 -3
- package/dist/domains/poseRun/usePoseRun.js +1 -2
- package/dist/domains/selection/enteredGroupFrame.js +1 -2
- package/dist/domains/selection/enteredGroupScope.js +1 -2
- package/dist/domains/selection/enteredOperands.js +1 -2
- package/dist/domains/selection/handleCommands.js +2 -3
- package/dist/domains/selection/overlay.js +6 -7
- package/dist/domains/selection/selectionPose.js +2 -3
- package/dist/domains/snap/angle2d.js +1 -2
- package/dist/domains/snap/debugCandidates.js +1 -2
- package/dist/domains/snap/gather.js +1 -2
- package/dist/domains/snap/inputSubspace.js +2 -3
- package/dist/domains/snap/lazySession.js +1 -2
- package/dist/domains/snap/marks.js +1 -2
- package/dist/domains/snap/outcomeStore.js +1 -2
- package/dist/domains/snap/pointSnap.js +1 -2
- package/dist/domains/snap/probes2d.js +1 -2
- package/dist/domains/snap/readoutDraw.js +1 -2
- package/dist/domains/snap/readoutLayer.js +1 -2
- package/dist/domains/snap/registry.js +1 -2
- package/dist/domains/snap/resizeBox.js +1 -2
- package/dist/domains/snap/roles.js +1 -2
- package/dist/domains/snap/rotationSource.js +1 -2
- package/dist/domains/snap/sceneReads.js +2 -3
- package/dist/domains/snap/sceneSession2d.js +2 -3
- package/dist/domains/snap/screen.js +2 -3
- package/dist/domains/snap/session2d.js +4 -5
- package/dist/domains/snap/spanSnap.js +1 -2
- package/dist/domains/snap/stepAngles.js +1 -2
- package/dist/domains/text/editingDrawOne.js +1 -2
- package/dist/domains/text/hostTextEditors.js +1 -2
- package/dist/domains/text/sceneTextDrafts.js +1 -2
- package/dist/domains/text/textHitAt.js +4 -5
- package/dist/domains/text/textLayer.js +12 -2
- package/dist/domains/text/textLayer.js.map +1 -1
- package/dist/domains/text/useSceneTextEdit.js +4 -5
- package/dist/domains/viewports/aim.js +3 -4
- package/dist/domains/viewports/viewMarker.js +1 -2
- package/dist/domains/viewports/viewMarkerDrag.js +1 -2
- package/dist/domains/viewports/viewResolver.js +1 -2
- package/dist/domains/viewports/viewportLayer.js +1 -2
- package/dist/iconRegistry/IconRegistryProvider.js +1 -2
- package/dist/iconRegistry/useIconGlyph.js +1 -2
- package/dist/iconRegistry/useIconVariant.js +1 -2
- package/dist/icons.table.js +1 -2
- package/dist/icons2.table.js +1 -2
- package/dist/index.d.ts +51 -7
- package/dist/index.js +3 -2
- package/dist/input/keyState.js +1 -2
- package/dist/input/useKeyModifiers.js +1 -2
- package/dist/input/useKeyState.js +1 -2
- package/dist/interactions/actions/admitsChild.js +1 -2
- package/dist/interactions/actions/align/action.js +6 -7
- package/dist/interactions/actions/align/align.js +6 -7
- package/dist/interactions/actions/booleans/action.js +1 -2
- package/dist/interactions/actions/booleans/booleanGroupAction.js +2 -3
- package/dist/interactions/actions/booleans/booleans.js +1 -2
- package/dist/interactions/actions/booleans/commit.js +4 -5
- package/dist/interactions/actions/booleans/custom.js +2 -3
- package/dist/interactions/actions/booleans/keymap.js +1 -2
- package/dist/interactions/actions/booleans/operands.js +1 -2
- package/dist/interactions/actions/booleans/pieces.js +1 -2
- package/dist/interactions/actions/booleans/placement.js +1 -2
- package/dist/interactions/actions/booleans/useBooleans.js +1 -2
- package/dist/interactions/actions/booleans/useBooleansAdapter.js +1 -2
- package/dist/interactions/actions/clipboard/action.js +2 -3
- package/dist/interactions/actions/clipboard/clipboardOps.js +2 -3
- package/dist/interactions/actions/clipboard/materializePaste.js +1 -2
- package/dist/interactions/actions/clipboard/wireFormat.js +1 -2
- package/dist/interactions/actions/clone/action.js +7 -8
- package/dist/interactions/actions/clone/behaviors.js +4 -5
- package/dist/interactions/actions/defaultCommitAdapter.js +2 -3
- package/dist/interactions/actions/defaults/anchorEditing.js +3 -4
- package/dist/interactions/actions/defaults/anchorFields.js +1 -2
- package/dist/interactions/actions/defaults/anchorHandles.js +2 -3
- package/dist/interactions/actions/defaults/anchorJoin.js +2 -3
- package/dist/interactions/actions/defaults/areaSelect.js +6 -6
- package/dist/interactions/actions/defaults/areaSelect.js.map +1 -1
- package/dist/interactions/actions/defaults/bendSegment.js +3 -4
- package/dist/interactions/actions/defaults/cancelGesture.js +1 -2
- package/dist/interactions/actions/defaults/clearSelection.js +1 -2
- package/dist/interactions/actions/defaults/containerScroll.js +4 -5
- package/dist/interactions/actions/defaults/contextMenu.js +6 -7
- package/dist/interactions/actions/defaults/copySubtree.js +2 -3
- package/dist/interactions/actions/defaults/createPaintAction.js +3 -4
- package/dist/interactions/actions/defaults/delete.js +2 -3
- package/dist/interactions/actions/defaults/duplicate.js +5 -6
- package/dist/interactions/actions/defaults/enterGroup.js +2 -3
- package/dist/interactions/actions/defaults/enterPathEdit.js +1 -2
- package/dist/interactions/actions/defaults/enterTextEdit.js +1 -2
- package/dist/interactions/actions/defaults/escape.js +1 -2
- package/dist/interactions/actions/defaults/exitPathEdit.js +1 -2
- package/dist/interactions/actions/defaults/group.js +6 -7
- package/dist/interactions/actions/defaults/ingest.js +3 -4
- package/dist/interactions/actions/defaults/insertPathAnchor.js +2 -3
- package/dist/interactions/actions/defaults/nudge.js +3 -4
- package/dist/interactions/actions/defaults/nudgeSteps.js +2 -3
- package/dist/interactions/actions/defaults/nudgeSteps.js.map +1 -1
- package/dist/interactions/actions/defaults/pathEditMarks.js +1 -2
- package/dist/interactions/actions/defaults/pinchZoom.js +3 -4
- package/dist/interactions/actions/defaults/reorder.js +2 -3
- package/dist/interactions/actions/defaults/requiresSelection.js +1 -2
- package/dist/interactions/actions/defaults/segmentUnder.js +1 -2
- package/dist/interactions/actions/defaults/selectAll.js +1 -2
- package/dist/interactions/actions/defaults/selectDeep.js +1 -2
- package/dist/interactions/actions/defaults/setFill.js +1 -2
- package/dist/interactions/actions/defaults/setFillOpacity.js +1 -2
- package/dist/interactions/actions/defaults/setStroke.js +1 -2
- package/dist/interactions/actions/defaults/setStrokeOpacity.js +1 -2
- package/dist/interactions/actions/defaults/slice.js +1 -2
- package/dist/interactions/actions/defaults/sliceOps.js +1 -2
- package/dist/interactions/actions/defaults/toolActivate.js +1 -2
- package/dist/interactions/actions/defaults/toolResetToDefault.js +1 -2
- package/dist/interactions/actions/defaults/undoRedo.js +1 -2
- package/dist/interactions/actions/defaults/viewportDragPan.js +1 -2
- package/dist/interactions/actions/defaults/viewportWheelPan.js +1 -2
- package/dist/interactions/actions/defaults/viewportZoom.js +3 -4
- package/dist/interactions/actions/distribute/action.js +4 -5
- package/dist/interactions/actions/distribute/distribute.js +5 -6
- package/dist/interactions/actions/distribute/plan.js +1 -2
- package/dist/interactions/actions/drawnBoxes.js +4 -5
- package/dist/interactions/actions/dropVerdict.js +1 -2
- package/dist/interactions/actions/edit-anchors/action.js +4 -5
- package/dist/interactions/actions/edit-anchors/extensionDrags.js +1 -2
- package/dist/interactions/actions/edit-anchors/geometry.js +1 -2
- package/dist/interactions/actions/edit-anchors/handleDrag.js +1 -2
- package/dist/interactions/actions/edit-anchors/handles.js +1 -2
- package/dist/interactions/actions/edit-anchors/params.js +1 -2
- package/dist/interactions/actions/edit-anchors/preview.js +1 -2
- package/dist/interactions/actions/edit-anchors/symmetry.js +1 -2
- package/dist/interactions/actions/flip/action.js +8 -9
- package/dist/interactions/actions/flip/helpers.js +1 -2
- package/dist/interactions/actions/geometryProjection.js +1 -2
- package/dist/interactions/actions/gestureFrames.js +3 -4
- package/dist/interactions/actions/gestureLifecycle.js +1 -2
- package/dist/interactions/actions/hitSelection.js +7 -3
- package/dist/interactions/actions/hitSelection.js.map +1 -1
- package/dist/interactions/actions/insert/action.js +6 -7
- package/dist/interactions/actions/insert/commit.js +2 -3
- package/dist/interactions/actions/insert/extras.js +1 -2
- package/dist/interactions/actions/insert/frame.js +1 -2
- package/dist/interactions/actions/insert/geometry.js +1 -2
- package/dist/interactions/actions/insert/params.js +2 -3
- package/dist/interactions/actions/insert/parent.js +1 -2
- package/dist/interactions/actions/insert/placeAction.js +5 -6
- package/dist/interactions/actions/insert/repositionAction.js +1 -2
- package/dist/interactions/actions/insert/rotateAction.js +1 -2
- package/dist/interactions/actions/insert/session.js +5 -6
- package/dist/interactions/actions/insert/shape.js +2 -3
- package/dist/interactions/actions/lasso-select/action.js +9 -9
- package/dist/interactions/actions/lasso-select/action.js.map +1 -1
- package/dist/interactions/actions/lasso-select/behaviors/selectFromLasso.js +2 -3
- package/dist/interactions/actions/magnification.js +37 -0
- package/dist/interactions/actions/magnification.js.map +1 -0
- package/dist/interactions/actions/move/action.js +2 -3
- package/dist/interactions/actions/move/behaviors/layoutDrop.js +2 -3
- package/dist/interactions/actions/move/behaviors/reparentOnDrop.js +2 -3
- package/dist/interactions/actions/move/behaviors/snapBackOrDelete.js +1 -2
- package/dist/interactions/actions/move/behaviors/snapToContainer.js +2 -3
- package/dist/interactions/actions/move/capture.js +6 -7
- package/dist/interactions/actions/move/commit/index.js +2 -3
- package/dist/interactions/actions/move/commit/layoutDrop.js +4 -5
- package/dist/interactions/actions/move/commit/layoutRelease.js +7 -8
- package/dist/interactions/actions/move/commit/rebase.js +2 -3
- package/dist/interactions/actions/move/commit/reparent.js +5 -6
- package/dist/interactions/actions/move/delta.js +2 -3
- package/dist/interactions/actions/move/frame.js +2 -3
- package/dist/interactions/actions/move/gestureAdapter.js +1 -2
- package/dist/interactions/actions/move/landedDescendants.js +2 -3
- package/dist/interactions/actions/move/layout/container.js +3 -4
- package/dist/interactions/actions/move/layout/dragged.js +2 -3
- package/dist/interactions/actions/move/layout/dropPass.js +5 -6
- package/dist/interactions/actions/move/layout/exits.js +2 -3
- package/dist/interactions/actions/move/layout/glide.js +2 -3
- package/dist/interactions/actions/move/layout/view.js +1 -2
- package/dist/interactions/actions/move/refusal.js +2 -3
- package/dist/interactions/actions/move/session.js +4 -5
- package/dist/interactions/actions/move/translate.js +2 -3
- package/dist/interactions/actions/moveNodes.js +5 -6
- package/dist/interactions/actions/notices.js +1 -2
- package/dist/interactions/actions/outlines/createOutlines.js +1 -2
- package/dist/interactions/actions/outlines/createOutlinesAction.js +2 -3
- package/dist/interactions/actions/outlines/outlineStroke.js +2 -3
- package/dist/interactions/actions/outlines/outlineStrokeAction.js +2 -3
- package/dist/interactions/actions/outlines/replaceWithPaths.js +5 -6
- package/dist/interactions/actions/outlines/strokeRegion.js +1 -2
- package/dist/interactions/actions/outlines/useCreateOutlinesAdapter.js +1 -2
- package/dist/interactions/actions/pathCommands/cutJoin.js +3 -4
- package/dist/interactions/actions/pathCommands/livePathEdit.js +3 -4
- package/dist/interactions/actions/pathCommands/pathNodes.js +3 -4
- package/dist/interactions/actions/pathCommands/simplifyOffset.js +2 -3
- package/dist/interactions/actions/pathGestureTags.js +1 -2
- package/dist/interactions/actions/planeInput.js +2 -3
- package/dist/interactions/actions/pointerState.js +1 -2
- package/dist/interactions/actions/poseDescriptorDep.js +1 -2
- package/dist/interactions/actions/poseFrame.js +3 -4
- package/dist/interactions/actions/resize/action.js +3 -4
- package/dist/interactions/actions/resize/aspect.js +1 -2
- package/dist/interactions/actions/resize/behaviors/clampMinSize.js +1 -2
- package/dist/interactions/actions/resize/boxFrame.js +1 -2
- package/dist/interactions/actions/resize/capture.js +7 -8
- package/dist/interactions/actions/resize/commit.js +3 -4
- package/dist/interactions/actions/resize/cornerHandles.js +1 -2
- package/dist/interactions/actions/resize/frame.js +7 -8
- package/dist/interactions/actions/resize/held.js +2 -3
- package/dist/interactions/actions/resize/minimum.js +1 -2
- package/dist/interactions/actions/resize/replay.js +1 -2
- package/dist/interactions/actions/resize/ruleBounds.js +1 -2
- package/dist/interactions/actions/resize/session.js +9 -10
- package/dist/interactions/actions/resolveOverlays.js +1 -2
- package/dist/interactions/actions/resolvePreviews.js +3 -4
- package/dist/interactions/actions/rotate/action.js +5 -6
- package/dist/interactions/actions/rotate/commit.js +2 -3
- package/dist/interactions/actions/rotate/frame.js +3 -4
- package/dist/interactions/actions/rotate/geometry.js +1 -2
- package/dist/interactions/actions/rotate/handle.js +2 -3
- package/dist/interactions/actions/rotate/replay.js +2 -3
- package/dist/interactions/actions/rotate/session.js +10 -11
- package/dist/interactions/actions/selectionSubtree.js +7 -22
- package/dist/interactions/actions/selectionSubtree.js.map +1 -1
- package/dist/interactions/actions/spatialReference.js +1 -2
- package/dist/interactions/actions/testUtils.js +1 -2
- package/dist/interactions/actions/transform-again/action.js +5 -6
- package/dist/interactions/actions/transform-again/memory.js +1 -2
- package/dist/interactions/actions/transformFinish.js +1 -2
- package/dist/interactions/actions/useActionSet.js +1 -2
- package/dist/interactions/actions/useNotices.js +1 -2
- package/dist/interactions/actions/useStandardActions.js +1 -2
- package/dist/interactions/gestures/dragGesture/dragGesture.js +1 -2
- package/dist/interactions/gestures/dragGesture/dragPointOf.js +1 -2
- package/dist/interactions/gestures/dragRadial/dragRadial.js +2 -3
- package/dist/interactions/gestures/dragRect/dragRect.js +2 -3
- package/dist/interactions/gestures/handleDrag/handleDrag.js +1 -2
- package/dist/interactions/gestures/pointerDrag/pointerDrag.js +1 -2
- package/dist/interactions/gestures/shared/originProjection.js +1 -2
- package/dist/interactions/gestures/shared/screenTolerance.js +1 -2
- package/dist/interactions/gestures/thresholdDrag/thresholdDrag.js +1 -2
- package/dist/kitSettingsSchema.js +4 -5
- package/dist/test-hook/createTestHook.js +1 -2
- package/dist/test-hook/install.js +1 -2
- package/dist/test-hook/useTestHook.js +1 -2
- package/dist/test-seams.d.ts +4 -4
- package/dist/test-seams.js +2 -2
- package/dist/tools/builtin/anchors/anchorsTool.js +1 -2
- package/dist/tools/builtin/ellipse/useEllipseTool.js +2 -3
- package/dist/tools/builtin/eyedropper/useEyedropperTool.js +1 -2
- package/dist/tools/builtin/hand/dragPanContribution.js +1 -2
- package/dist/tools/builtin/hand/useHandTool.js +1 -2
- package/dist/tools/builtin/image/useImageTool.js +1 -2
- package/dist/tools/builtin/lasso/useLassoTool.js +1 -2
- package/dist/tools/builtin/line/useLineTool.js +2 -3
- package/dist/tools/builtin/measure/useMeasureTool.js +2 -3
- package/dist/tools/builtin/pen/penHandle.js +1 -2
- package/dist/tools/builtin/pen/usePenTool.js +6 -7
- package/dist/tools/builtin/pencil/usePencilTool.js +1 -2
- package/dist/tools/builtin/pickTopMostHit.js +1 -2
- package/dist/tools/builtin/polygon/usePolygonTool.js +3 -4
- package/dist/tools/builtin/pressTarget.js +1 -2
- package/dist/tools/builtin/rect/useRectTool.js +2 -3
- package/dist/tools/builtin/select/adapterPointQuery.js +3 -4
- package/dist/tools/builtin/select/collapseDeferred.js +1 -2
- package/dist/tools/builtin/select/groupEntry.js +2 -3
- package/dist/tools/builtin/select/pressDecision.js +3 -4
- package/dist/tools/builtin/select/pressDecision.js.map +1 -1
- package/dist/tools/builtin/select/selectionContributions.js +1 -2
- package/dist/tools/builtin/select/useSelectTool.js +5 -6
- package/dist/tools/builtin/shared/insertToolOptions.js +1 -2
- package/dist/tools/builtin/shared/pointerFollower.js +1 -2
- package/dist/tools/builtin/slice/useSliceTool.js +5 -6
- package/dist/tools/builtin/star/useStarTool.js +3 -4
- package/dist/tools/builtin/sticky/stickyNode.js +1 -2
- package/dist/tools/builtin/sticky/useStickyTool.js +2 -3
- package/dist/tools/builtin/text/useTextTool.js +1 -2
- package/dist/tools/index.js +2 -2
- package/dist/tools/overlayBinding.js +1 -2
- package/dist/tools/toolOptions.js +17 -4
- package/dist/tools/toolOptions.js.map +1 -1
- package/dist/tools/useKeybindings.js +1 -2
- package/dist/{types-DW14eu9B.d.ts → types-BUvUXZe5.d.ts} +3 -3
- package/dist/util/color.js +1 -2
- package/dist/util/paint.js +1 -2
- package/dist/version.js +2 -3
- package/package.json +27 -27
|
@@ -2,7 +2,7 @@ import { clientToWorld } from "../core/viewport/clientToWorld.js";
|
|
|
2
2
|
import { useCallback } from "react";
|
|
3
3
|
import { useLatest } from "@weasel-js/react";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/canvas/useClientToWorld.ts
|
|
6
6
|
/**
|
|
7
7
|
* The canvas's one client→world conversion: hover, the view registry and both handles answer
|
|
8
8
|
* with it, so a `clientToWorld` override reaches all of them or none.
|
|
@@ -22,6 +22,5 @@ function useClientToWorld(elementRef, clientToWorld$1, viewRef) {
|
|
|
22
22
|
]);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
//#endregion
|
|
26
25
|
export { useClientToWorld };
|
|
27
26
|
//# sourceMappingURL=useClientToWorld.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isLayerPainted } from "../core/layers/render.js";
|
|
2
2
|
import { useCallback, useRef, useState } from "react";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/canvas/useExtraLayers.ts
|
|
5
5
|
var alwaysVisible = (_id) => true;
|
|
6
6
|
var NO_LAYER_VISIBILITY = {};
|
|
7
7
|
/** Layers attached from outside the `layers` prop (a HUD, a loupe), and hit-testing over them. */
|
|
@@ -40,6 +40,5 @@ function useExtraLayers(gateRef) {
|
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
//#endregion
|
|
44
43
|
export { NO_LAYER_VISIBILITY, alwaysVisible, useExtraLayers };
|
|
45
44
|
//# sourceMappingURL=useExtraLayers.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useCallback, useInsertionEffect, useLayoutEffect, useRef } from "react";
|
|
2
2
|
import { useLatest, useVisibleRaf } from "@weasel-js/react";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/canvas/useFrameLoop.ts
|
|
5
5
|
/**
|
|
6
6
|
* The frame loop behind `<Canvas>`: a dirty flag, one frame in flight at a
|
|
7
7
|
* time, and a subscriber set notified after a paint lands. When frames may run
|
|
@@ -122,6 +122,5 @@ function useFrameLoop(paint, options = {}) {
|
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
//#endregion
|
|
126
125
|
export { useFrameLoop };
|
|
127
126
|
//# sourceMappingURL=useFrameLoop.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
2
|
import { useLatest } from "@weasel-js/react";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/canvas/useHitObserver.ts
|
|
5
5
|
/** Turns a consumer's hit callback into the world-point observer the gesture
|
|
6
6
|
* dispatcher takes, resolving the hit with the canvas's own picker. Identity
|
|
7
7
|
* changes only between wired and not, so the dispatcher isn't rebuilt per
|
|
@@ -25,6 +25,5 @@ function useHitObserver(cb, pickerRef) {
|
|
|
25
25
|
]);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
//#endregion
|
|
29
28
|
export { useHitObserver };
|
|
30
29
|
//# sourceMappingURL=useHitObserver.js.map
|
|
@@ -3,7 +3,7 @@ import { watchElementMove } from "./watchElementMove.js";
|
|
|
3
3
|
import { useCallback, useEffect, useState } from "react";
|
|
4
4
|
import { useLatest, useVisibleRaf } from "@weasel-js/react";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/canvas/useHostAnchor.ts
|
|
7
7
|
/**
|
|
8
8
|
* Hold a fixed-position panel against a host element's corner, kept inside the
|
|
9
9
|
* viewport, following it through scrolls, resizes, and reflows, a host moved by
|
|
@@ -98,6 +98,5 @@ function useHostAnchor(resolveHost, options) {
|
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
//#endregion
|
|
102
101
|
export { useHostAnchor };
|
|
103
102
|
//# sourceMappingURL=useHostAnchor.js.map
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { useCallback, useRef } from "react";
|
|
2
2
|
import { useLatest } from "@weasel-js/react";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/canvas/useInFlightBounds.ts
|
|
5
5
|
/**
|
|
6
6
|
* Where a view boxes the nodes an in-flight gesture names: at the pose a
|
|
7
|
-
* source previews, else at the node's effective pose — a transform's poses
|
|
7
|
+
* source previews, carried to world, else at the node's effective pose — a transform's poses
|
|
8
8
|
* live in the scene's overrides, not on its handle. Boxed through `boxOf`
|
|
9
9
|
* either way, since a consumer `boundsOf` answers for the document pose only.
|
|
10
10
|
*/
|
|
11
11
|
function useInFlightBounds(args) {
|
|
12
|
-
const { gestureSource, boxOf, committedPoseOf } = args;
|
|
12
|
+
const { gestureSource, boxOf, committedPoseOf, worldOfStored } = args;
|
|
13
13
|
const previewPoseExtraRef = useLatest(args.previewPoseExtra);
|
|
14
14
|
const previewPoseOf = useCallback((id) => {
|
|
15
15
|
const p = previewPoseExtraRef.current?.(id);
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
if (p == null) return null;
|
|
17
|
+
return worldOfStored ? worldOfStored(id, p) : p;
|
|
18
|
+
}, [previewPoseExtraRef, worldOfStored]);
|
|
18
19
|
const inFlight = useRef(null);
|
|
19
20
|
const isInFlight = useCallback((id) => {
|
|
20
21
|
if (!gestureSource) return false;
|
|
@@ -47,6 +48,5 @@ function useInFlightBounds(args) {
|
|
|
47
48
|
};
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
//#endregion
|
|
51
51
|
export { useInFlightBounds };
|
|
52
52
|
//# sourceMappingURL=useInFlightBounds.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInFlightBounds.js","names":[],"sources":["../../src/canvas/useInFlightBounds.ts"],"sourcesContent":["import { useCallback, useRef } from 'react';\nimport { useLatest } from '@weasel-js/react';\nimport type { GestureSource } from './gestureBounds';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\n\n/**\n * Where a view boxes the nodes an in-flight gesture names: at the pose a\n * source previews, else at the node's effective pose — a transform's poses\n * live in the scene's overrides, not on its handle. Boxed through `boxOf`\n * either way, since a consumer `boundsOf` answers for the document pose only.\n */\nexport function useInFlightBounds<TPose>(args: {\n gestureSource: GestureSource | undefined;\n /** Read through a ref, so a change mid-gesture rebuilds nothing. */\n previewPoseExtra: ((id: string) => unknown) | undefined;\n boxOf: (id: string, pose: TPose) => Bounds | null;\n /** The node's effective world pose. */\n committedPoseOf: (id: string) => TPose | null;\n}): {\n previewPoseOf: (id: string) => TPose | null;\n previewBoundsOf: (id: string) => Bounds | null;\n} {\n const { gestureSource, boxOf, committedPoseOf } = args;\n const previewPoseExtraRef = useLatest(args.previewPoseExtra);\n const previewPoseOf = useCallback((id: string): TPose | null => {\n const p = previewPoseExtraRef.current?.(id);\n
|
|
1
|
+
{"version":3,"file":"useInFlightBounds.js","names":[],"sources":["../../src/canvas/useInFlightBounds.ts"],"sourcesContent":["import { useCallback, useRef } from 'react';\nimport { useLatest } from '@weasel-js/react';\nimport type { GestureSource } from './gestureBounds';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\n\n/**\n * Where a view boxes the nodes an in-flight gesture names: at the pose a\n * source previews, carried to world, else at the node's effective pose — a transform's poses\n * live in the scene's overrides, not on its handle. Boxed through `boxOf`\n * either way, since a consumer `boundsOf` answers for the document pose only.\n */\nexport function useInFlightBounds<TPose>(args: {\n gestureSource: GestureSource | undefined;\n /** Read through a ref, so a change mid-gesture rebuilds nothing. */\n previewPoseExtra: ((id: string) => unknown) | undefined;\n boxOf: (id: string, pose: TPose) => Bounds | null;\n /** The node's effective world pose. */\n committedPoseOf: (id: string) => TPose | null;\n /** Where `id` is drawn if it stores `stored`: a previewed pose is in the\n * frame the node is stored in, as a published override is. Absent means\n * stored poses are world. */\n worldOfStored?: ((id: string, stored: TPose) => TPose) | undefined;\n}): {\n previewPoseOf: (id: string) => TPose | null;\n previewBoundsOf: (id: string) => Bounds | null;\n} {\n const { gestureSource, boxOf, committedPoseOf, worldOfStored } = args;\n const previewPoseExtraRef = useLatest(args.previewPoseExtra);\n const previewPoseOf = useCallback((id: string): TPose | null => {\n const p = previewPoseExtraRef.current?.(id);\n if (p == null) return null;\n return worldOfStored ? worldOfStored(id, p as TPose) : (p as TPose);\n }, [previewPoseExtraRef, worldOfStored]);\n\n // The source's ids, re-read only when its version moves.\n const inFlight = useRef<{ source: GestureSource; version: number; ids: ReadonlySet<string> } | null>(null);\n const isInFlight = useCallback((id: string): boolean => {\n if (!gestureSource) return false;\n const version = gestureSource.getVersion();\n let entry = inFlight.current;\n if (entry === null || entry.source !== gestureSource || entry.version !== version) {\n entry = { source: gestureSource, version, ids: new Set(gestureSource.ids() ?? []) };\n inFlight.current = entry;\n }\n return entry.ids.has(id);\n }, [gestureSource]);\n\n const previewBoundsOf = useCallback((id: string): Bounds | null => {\n const p = previewPoseOf(id);\n if (p != null) return boxOf(id, p);\n if (!isInFlight(id)) return null;\n const shown = committedPoseOf(id);\n return shown != null ? boxOf(id, shown) : null;\n }, [previewPoseOf, boxOf, isInFlight, committedPoseOf]);\n\n return { previewPoseOf, previewBoundsOf };\n}\n"],"mappings":";;;;;;;;;;AAWA,SAAgB,kBAAyB,MAcvC;CACA,MAAM,EAAE,eAAe,OAAO,iBAAiB,kBAAkB;CACjE,MAAM,sBAAsB,UAAU,KAAK,gBAAgB;CAC3D,MAAM,gBAAgB,aAAa,OAA6B;EAC9D,MAAM,IAAI,oBAAoB,UAAU,EAAE;EAC1C,IAAI,KAAK,MAAM,OAAO;EACtB,OAAO,gBAAgB,cAAc,IAAI,CAAU,IAAK;CAC1D,GAAG,CAAC,qBAAqB,aAAa,CAAC;CAGvC,MAAM,WAAW,OAAoF,IAAI;CACzG,MAAM,aAAa,aAAa,OAAwB;EACtD,IAAI,CAAC,eAAe,OAAO;EAC3B,MAAM,UAAU,cAAc,WAAW;EACzC,IAAI,QAAQ,SAAS;EACrB,IAAI,UAAU,QAAQ,MAAM,WAAW,iBAAiB,MAAM,YAAY,SAAS;GACjF,QAAQ;IAAE,QAAQ;IAAe;IAAS,KAAK,IAAI,IAAI,cAAc,IAAI,KAAK,CAAC,CAAC;GAAE;GAClF,SAAS,UAAU;EACrB;EACA,OAAO,MAAM,IAAI,IAAI,EAAE;CACzB,GAAG,CAAC,aAAa,CAAC;CAUlB,OAAO;EAAE;EAAe,iBARA,aAAa,OAA8B;GACjE,MAAM,IAAI,cAAc,EAAE;GAC1B,IAAI,KAAK,MAAM,OAAO,MAAM,IAAI,CAAC;GACjC,IAAI,CAAC,WAAW,EAAE,GAAG,OAAO;GAC5B,MAAM,QAAQ,gBAAgB,EAAE;GAChC,OAAO,SAAS,OAAO,MAAM,IAAI,KAAK,IAAI;EAC5C,GAAG;GAAC;GAAe;GAAO;GAAY;EAAe,CAE7B;CAAgB;AAC1C"}
|
|
@@ -3,7 +3,7 @@ import { subscribeImageReady } from "@weasel-js/renderer";
|
|
|
3
3
|
import { useEffect } from "react";
|
|
4
4
|
import { subscribeGlyphReady } from "@weasel-js/font";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/canvas/useLateContentRedraw.ts
|
|
7
7
|
/**
|
|
8
8
|
* Repaint whenever something a frame could not draw becomes drawable: an image
|
|
9
9
|
* finishes decoding, a deferred glyph bake or font load lands, or a paint kind
|
|
@@ -23,6 +23,5 @@ function useLateContentRedraw(requestRedraw) {
|
|
|
23
23
|
}, [requestRedraw]);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
//#endregion
|
|
27
26
|
export { useLateContentRedraw };
|
|
28
27
|
//# sourceMappingURL=useLateContentRedraw.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createBackgroundFillLayer } from "../core/layers/backgroundFill.js";
|
|
2
|
-
import { isCustomEntry } from "./layerSlots.js";
|
|
3
2
|
import { composeOrderedLayers, placeToolOverlays } from "./layerOrder.js";
|
|
3
|
+
import { isCustomEntry } from "./layerSlots.js";
|
|
4
4
|
import { useCallback, useEffect, useMemo, useSyncExternalStore } from "react";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/canvas/useLayerStack.ts
|
|
7
7
|
/** The `layers` prop's slots and custom entries in draw order, with the background fill beneath,
|
|
8
8
|
* the decoration layer above, and the active tool's overlays placed among them. */
|
|
9
9
|
function useSlotLayers(layersMap, tools, backgroundFill, decorationLayer) {
|
|
@@ -71,6 +71,5 @@ function useComposedLayers(layers, above, requestRedraw) {
|
|
|
71
71
|
return composed;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
//#endregion
|
|
75
74
|
export { useComposedLayers, useSlotLayers };
|
|
76
75
|
//# sourceMappingURL=useLayerStack.js.map
|
|
@@ -2,7 +2,7 @@ import { createPaintedCursorLayer } from "./paintedCursorLayer.js";
|
|
|
2
2
|
import { useEffect, useMemo } from "react";
|
|
3
3
|
import { createCursorSink, createPaintedCursorState } from "@weasel-js/cursor";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/canvas/usePaintedCursor.ts
|
|
6
6
|
/**
|
|
7
7
|
* The painted cursor tier's channel. The canvas owns it because it owns both ends: the tool
|
|
8
8
|
* cursor that feeds it and the frame loop that has to repaint when it changes.
|
|
@@ -23,6 +23,5 @@ function usePaintedCursor(canvasRef, requestRedraw) {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
//#endregion
|
|
27
26
|
export { usePaintedCursor };
|
|
28
27
|
//# sourceMappingURL=usePaintedCursor.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useState } from "react";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/canvas/useRedrawOn.ts
|
|
4
4
|
/** Subscribe `requestRedraw` to each source while mounted. An inline array
|
|
5
5
|
* holding the same sources does not resubscribe. */
|
|
6
6
|
function useRedrawOn(sources, requestRedraw) {
|
|
@@ -26,6 +26,5 @@ function useSameElements(list) {
|
|
|
26
26
|
return kept;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
//#endregion
|
|
30
29
|
export { useRedrawOn };
|
|
31
30
|
//# sourceMappingURL=useRedrawOn.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { sceneToAdapter } from "./sceneAdapter.js";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/canvas/useSceneAdapter.ts
|
|
5
5
|
/**
|
|
6
6
|
* React-hook wrapper around `sceneToAdapter`. Memoizes on every option, so
|
|
7
7
|
* the adapter keeps its identity across renders unless one of them changes.
|
|
@@ -24,6 +24,5 @@ function useSceneAdapter(scene, options = {}) {
|
|
|
24
24
|
]);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
//#endregion
|
|
28
27
|
export { useSceneAdapter };
|
|
29
28
|
//# sourceMappingURL=useSceneAdapter.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback, useSyncExternalStore } from "react";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/canvas/useSceneLayerList.ts
|
|
4
4
|
var UNSUBSCRIBED = () => {};
|
|
5
5
|
var read = (adapter) => typeof adapter?.getLayers === "function" ? adapter.getLayers().map((l) => l.id).join("\n") : "";
|
|
6
6
|
/**
|
|
@@ -14,6 +14,5 @@ function useSceneLayerList(adapter) {
|
|
|
14
14
|
return useSyncExternalStore(subscribe, snapshot, snapshot);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
//#endregion
|
|
18
17
|
export { useSceneLayerList };
|
|
19
18
|
//# sourceMappingURL=useSceneLayerList.js.map
|
|
@@ -2,7 +2,7 @@ import { useLayoutEffect, useRef } from "react";
|
|
|
2
2
|
import { useLatest } from "@weasel-js/react";
|
|
3
3
|
import { heldPointers } from "@weasel-js/gestures";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/canvas/useSurfaceInput.ts
|
|
6
6
|
/**
|
|
7
7
|
* Listen on whichever element `elementRef` holds, moving the listeners when
|
|
8
8
|
* it holds another. Handlers are read at event time, so a new set never
|
|
@@ -53,6 +53,5 @@ function listen(element, live) {
|
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
//#endregion
|
|
57
56
|
export { useSurfaceInput };
|
|
58
57
|
//# sourceMappingURL=useSurfaceInput.js.map
|
|
@@ -2,7 +2,7 @@ import { useElementSize } from "../core/viewport/useCanvasSize.js";
|
|
|
2
2
|
import { useEffect, useRef } from "react";
|
|
3
3
|
import { useLatest } from "@weasel-js/react";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/canvas/useSurfaceSize.ts
|
|
6
6
|
var NO_ELEMENT = { current: null };
|
|
7
7
|
var FILL = { beforePaint: true };
|
|
8
8
|
/**
|
|
@@ -39,6 +39,5 @@ function useSurfaceSize(props, element) {
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
//#endregion
|
|
43
42
|
export { useSurfaceSize };
|
|
44
43
|
//# sourceMappingURL=useSurfaceSize.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useLayoutEffect } from "react";
|
|
2
2
|
import { resolveCursorTier } from "@weasel-js/cursor";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/canvas/useToolCursor.ts
|
|
5
5
|
function resolveToolsCursor(tools) {
|
|
6
6
|
const id = tools.hotkeyEngaged ?? tools.active;
|
|
7
7
|
const tool = id === null ? void 0 : tools.registry[id];
|
|
@@ -33,6 +33,5 @@ function useToolCursor(sink, tools, element, rest) {
|
|
|
33
33
|
]);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
//#endregion
|
|
37
36
|
export { useToolCursor };
|
|
38
37
|
//# sourceMappingURL=useToolCursor.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { normalizeView } from "../core/viewport/view.js";
|
|
2
|
-
import { isRectAim, rectAim, viewForAim } from "../domains/viewports/aim.js";
|
|
3
2
|
import { viewportWorldRect } from "../core/viewport/viewportWorldRect.js";
|
|
3
|
+
import { isRectAim, rectAim, viewForAim } from "../domains/viewports/aim.js";
|
|
4
4
|
import { useCanvasView } from "./useCanvasView.js";
|
|
5
5
|
import { sizeOf } from "./useViewNesting.js";
|
|
6
6
|
import { IDENTITY_VIEW, UNMEASURED_DIMS } from "./viewRegistry.js";
|
|
7
7
|
import { useCallback } from "react";
|
|
8
8
|
import { useLatest } from "@weasel-js/react";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// src/canvas/useViewAim.ts
|
|
11
11
|
/**
|
|
12
12
|
* A `<CanvasView>`'s camera and its aim, whichever of the two the view holds.
|
|
13
13
|
* A camera-held view answers its aim from its camera; an aim-held one derives
|
|
@@ -116,6 +116,5 @@ function useViewAim(args) {
|
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
//#endregion
|
|
120
119
|
export { useViewAim };
|
|
121
120
|
//# sourceMappingURL=useViewAim.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { unionAABB } from "../core/geometry/unionBounds.js";
|
|
2
1
|
import { framedBounds } from "../core/geometry/poseDescriptor.js";
|
|
3
2
|
import { useInFlightBounds } from "./useInFlightBounds.js";
|
|
3
|
+
import { unionAABB } from "../core/geometry/unionBounds.js";
|
|
4
4
|
import { buildChromeState } from "../core/selection/chromeState.js";
|
|
5
5
|
import { drawnBoundsOf } from "./drawnBounds.js";
|
|
6
6
|
import { useCallback, useMemo } from "react";
|
|
7
7
|
import { useLatest } from "@weasel-js/react";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// src/canvas/useViewHelpers.ts
|
|
10
10
|
var noOpUnsubscribe = () => {};
|
|
11
11
|
var alwaysVisible = () => true;
|
|
12
12
|
function worldPoseOf(adapter, id) {
|
|
@@ -60,11 +60,13 @@ function useViewHelpers(opts) {
|
|
|
60
60
|
}, [adapter]);
|
|
61
61
|
const selectionRef = useLatest(selection);
|
|
62
62
|
const effectiveBoundsOf = useMemo(() => boundsOf ?? baseBoundsOf, [boundsOf, baseBoundsOf]);
|
|
63
|
+
const worldOfStored = useMemo(() => adapter?.worldOfStored ? (id, stored) => adapter.worldOfStored(id, stored) : void 0, [adapter]);
|
|
63
64
|
const { previewPoseOf, previewBoundsOf } = useInFlightBounds({
|
|
64
65
|
gestureSource,
|
|
65
66
|
previewPoseExtra,
|
|
66
67
|
boxOf,
|
|
67
|
-
committedPoseOf
|
|
68
|
+
committedPoseOf,
|
|
69
|
+
worldOfStored
|
|
68
70
|
});
|
|
69
71
|
/**
|
|
70
72
|
* Bounds for `id` with any in-flight gesture folded in — what the user can
|
|
@@ -128,6 +130,5 @@ function useViewHelpers(opts) {
|
|
|
128
130
|
} };
|
|
129
131
|
}
|
|
130
132
|
|
|
131
|
-
//#endregion
|
|
132
133
|
export { useViewHelpers };
|
|
133
134
|
//# sourceMappingURL=useViewHelpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useViewHelpers.js","names":[],"sources":["../../src/canvas/useViewHelpers.ts"],"sourcesContent":["import { useCallback, useMemo } from 'react';\nimport { framedBounds } from 'core/geometry/poseDescriptor';\nimport { useLatest } from '@weasel-js/react';\nimport type { GestureSource, GesturePreviewSource } from './gestureBounds';\nimport { useInFlightBounds } from './useInFlightBounds';\nimport type { OngoingOverlay } from '@weasel-js/routing';\nimport { unionAABB } from 'core/geometry/unionBounds';\nimport { buildChromeState, type ChromeState } from 'core/selection/chromeState';\nimport type { PoseDescriptor } from 'interactions/actions/resize/geometry';\nimport type { NodeId } from 'core/scene/types';\nimport type { DebugSink } from '../debug/types';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\nimport type { Scale2 } from '@weasel-js/geom';\nimport { drawnBoundsOf, type DrawnBoundsScene } from './drawnBounds';\n\nconst noOpUnsubscribe = (): void => {};\n\nconst alwaysVisible = (): boolean => true;\n\n/**\n * The half of {@link CanvasHelpers} that belongs to one view — everything\n * answered by a camera's own tools, gestures and selection. A canvas hosting\n * several viewports needs one of these per view; the surface half is shared.\n */\nexport interface CanvasViewHelpers<TPose> {\n /** Pose currently displayed for `id` — drag/resize/rotate overlay if active,\n * otherwise the committed pose from the adapter. Returns `null` if the id\n * isn't known. */\n getEffectivePose(id: string): TPose | null;\n /** Overlay-aware bounds for `id`. */\n getEffectiveBounds(id: string): Bounds | null;\n /**\n * World-space AABB of everything the in-flight gesture proposes — the\n * displaced poses of nodes being moved / resized / rotated / cloned, plus\n * any nascent insert that has no scene node yet. `null` when no gesture is\n * in flight.\n *\n * This reports the *gesture*, not the document: committed content the\n * gesture isn't touching is excluded. Select-only gestures are excluded\n * too: a marquee or lasso has geometry but proposes no content.\n *\n * The result is a plain AABB — never rotated. Rotated parts are folded in\n * by their rotated extent.\n */\n getGestureBounds(): Bounds | null;\n /**\n * Subscribe to the gesture layer's change signal, for everything on this\n * object that moves during a drag (`getEffectivePose`, `getEffectiveBounds`,\n * `getGestureBounds`). Returns an unsubscribe.\n *\n * Fires once per dispatcher pump: gesture start, every pointermove that\n * reaches an in-flight handle, end, and cancel — plus UI-driven ongoing\n * actions. It fires on the pump, not on a diff: a pump that changed nothing\n * observable still notifies, so don't hang expensive work directly off the\n * callback.\n *\n * It does **not** cover committed scene edits (subscribe to the scene for\n * those) or previews a consumer's own tool publishes from React state.\n * Without a gesture source wired — a bare `<Canvas>` — it never fires.\n */\n subscribeGestures(fn: () => void): () => void;\n /**\n * Monotonic counter bumped on exactly the events `subscribeGestures` fires\n * on. Pair the two for `useSyncExternalStore`:\n *\n * ```ts\n * const gestureVersion = useSyncExternalStore(\n * useCallback((cb) => helpersRef.current?.subscribeGestures(cb) ?? (() => {}), []),\n * () => helpersRef.current?.getGestureVersion() ?? 0,\n * );\n * ```\n *\n * Starts at 0 and only increases. `0` is also what a bare `<Canvas>` with\n * no gesture source reports, forever.\n */\n getGestureVersion(): number;\n /** The live ChromeState built once per render: overlay-aware selection\n * state for affordances and custom layers. */\n getChromeState(): ChromeState;\n /**\n * Everything publishing an in-flight preview for this view: the handles in\n * flight on its dispatcher, in dispatch order. Readers take the first\n * non-null answer per id.\n *\n * A ghost layer must read this off its draw envelope rather than close over\n * a dispatcher: one layer array paints every view, so a closure ghosts view\n * zero's drag into every panel.\n */\n getPreviewSources(): readonly GesturePreviewSource[];\n /** Overlay shapes this view's in-flight handles publish — marquee, lasso,\n * insert preview, raw commands. Same envelope rule as\n * {@link CanvasViewHelpers.getPreviewSources}. */\n getGestureOverlays(): readonly OngoingOverlay[];\n /**\n * Chrome-caps visibility predicate, keyed by chrome id. Overlay layers and\n * affordances call it per element to decide whether to draw / hit-test.\n * Unwired, it is the universal `() => true`.\n */\n getIsVisible(): (id: string) => boolean;\n}\n\n/**\n * The half of {@link CanvasHelpers} that belongs to the surface — one GL\n * context, one debug sink, however many views are drawn on it.\n */\nexport interface CanvasSurfaceHelpers {\n /** Active debug sink, when `<Canvas debug=...>` is enabled, for layers to\n * call from their `draw` callback. `null` when debug is off. */\n getDebug(): DebugSink | null;\n}\n\n/** Live overlay-aware lookups exposed to custom layers via `helpersRef`, and\n * what a layer receives as its `data` argument. */\nexport interface CanvasHelpers<TPose> extends CanvasViewHelpers<TPose>, CanvasSurfaceHelpers {\n /**\n * The view this draw is for: a `<CanvasView>` id, or `null` for the\n * surface's own camera. One layer array paints every view, so a layer that\n * belongs in some views and not others — a minimap's indicator — declines\n * the rest by this id.\n */\n readonly viewId: string | null;\n}\n\n/** What a view's pose and bounds lookups read of an adapter. */\nexport interface ViewPoseAdapter<TPose> {\n getPose(id: string): TPose;\n /** Where the node is drawn, when the adapter composes poses. An adapter\n * without it stores absolute poses, where the two agree. */\n getWorldPose?(id: string): TPose;\n /** The node an id names, whose `layer` decides whether a view that hides\n * that layer shows its selection chrome. */\n getNode?(id: string): { layer?: string } | undefined;\n}\n\nexport interface UseViewHelpersOpts<TPose> {\n adapter: ViewPoseAdapter<TPose> | undefined;\n geometry: PoseDescriptor<TPose>;\n /** Consumer-supplied bounds resolver. Falls back to the adapter's pose. */\n boundsOf: ((id: string) => Bounds | null) | undefined;\n /** Bounds of `id` drawn at an in-flight `pose`. Falls back to the\n * geometry's box of that pose, which is wrong wherever the surface draws a\n * node somewhere its pose does not say — a parallax plane. */\n boundsOfPose?: ((id: string, pose: TPose) => Bounds | null) | undefined;\n /** The nodes the adapter's ids name: with them, the fallbacks box each as\n * drawn, stroke included, rather than by its pose. */\n nodes?: DrawnBoundsScene | undefined;\n /** The view's scale, which a screen-pixel stroke is resolved at. Default 1. */\n getScale?: (() => Scale2) | undefined;\n /** The ids selected, read whenever chrome asks: a view following another\n * reads that view's, which changes without this one rendering. */\n selection: () => readonly NodeId[];\n gestureSource: GestureSource | undefined;\n /** The dispatcher's preview pose for an id, read through a ref so a change\n * mid-gesture doesn't rebuild the memos that depend on it. */\n previewPoseExtra: ((id: string) => unknown) | undefined;\n /** Chrome-caps predicate for this view. Absent means everything is visible. */\n getIsVisible?: (() => (id: string) => boolean) | undefined;\n /** Whether a scene layer reaches the screen in this view. Absent means\n * every layer the scene shows does. */\n layerIsPainted?: ((layerId: string) => boolean) | undefined;\n}\n\nexport interface ViewHelpersBundle<TPose> {\n helpers: CanvasViewHelpers<TPose>;\n}\n\nfunction worldPoseOf<TPose>(adapter: ViewPoseAdapter<TPose>, id: string): TPose {\n return typeof adapter.getWorldPose === 'function' ? adapter.getWorldPose(id) : adapter.getPose(id);\n}\n\n/**\n * Build one view's overlay-aware state: its chrome and the lookups its layers\n * draw and hit-test against. A canvas with N views mounts N components each\n * calling this once.\n */\nexport function useViewHelpers<TPose>(\n opts: UseViewHelpersOpts<TPose>,\n): ViewHelpersBundle<TPose> {\n const {\n adapter, geometry, boundsOf, boundsOfPose, nodes, getScale, selection, gestureSource,\n previewPoseExtra, getIsVisible, layerIsPainted,\n } = opts;\n const getScaleRef = useLatest(getScale);\n const poseBoxOf = useCallback((id: string, pose: TPose): Bounds => {\n if (!nodes) return framedBounds(pose, geometry);\n const scale = getScaleRef.current?.();\n return drawnBoundsOf(nodes, id as NodeId, pose, {\n descriptor: geometry as PoseDescriptor<unknown>,\n ...(adapter ? { worldPoseOf: (m: NodeId) => worldPoseOf(adapter, m) } : {}),\n ...(scale ? { scale } : {}),\n });\n }, [nodes, geometry, adapter, getScaleRef]);\n const boxOf = useCallback(\n (id: string, pose: TPose): Bounds | null =>\n (boundsOfPose ? boundsOfPose(id, pose) : poseBoxOf(id, pose)),\n [boundsOfPose, poseBoxOf],\n );\n\n const baseBoundsOf = useMemo(() => {\n if (boundsOf) return boundsOf;\n if (!adapter) return undefined;\n return (id: string): Bounds | null => {\n try {\n // World: chrome is drawn over the picture, so it has to agree with\n // where the renderer put the node, not with where its pose is stored.\n return poseBoxOf(id, worldPoseOf(adapter, id));\n } catch {\n return null;\n }\n };\n }, [boundsOf, adapter, poseBoxOf]);\n\n const committedPoseOf = useCallback((id: string): TPose | null => {\n if (!adapter) return null;\n try {\n return worldPoseOf(adapter, id);\n } catch {\n return null;\n }\n }, [adapter]);\n\n const selectionRef = useLatest(selection);\n\n const effectiveBoundsOf = useMemo(() => boundsOf ?? baseBoundsOf, [boundsOf, baseBoundsOf]);\n const { previewPoseOf, previewBoundsOf } = useInFlightBounds({ gestureSource, previewPoseExtra, boxOf, committedPoseOf });\n\n /**\n * Bounds for `id` with any in-flight gesture folded in — what the user can\n * see, not what is committed. Both the chrome state and the layer helpers\n * answer bounds questions with this, so resize handles cannot end up a frame\n * away from the shape they belong to.\n */\n const boundsWithPreview = useCallback((id: string): Bounds | null => {\n const previewed = previewBoundsOf(id);\n if (previewed) return previewed;\n return effectiveBoundsOf ? effectiveBoundsOf(id) : null;\n }, [previewBoundsOf, effectiveBoundsOf]);\n\n const chromeState: ChromeState = useMemo(\n () => buildChromeState({\n get selection() { return selectionRef.current(); },\n get multiActive() { return selectionRef.current().length > 1; },\n effectiveBoundsOf: boundsWithPreview,\n modifiers: { alt: false, shift: false, meta: false, ctrl: false },\n // Absent adapter / unknown ids fall back to `true` so the affordance\n // stays visible for consumers that wire bounds without an adapter.\n canRotate: (id) => {\n if (!geometry.supportsRotation) return true;\n const pose = committedPoseOf(id);\n if (pose == null) return true;\n return geometry.supportsRotation(pose);\n },\n ...(layerIsPainted ? { layerIsPainted } : {}),\n ...(adapter?.getNode ? { layerOf: (id: string) => adapter.getNode?.(id)?.layer } : {}),\n }),\n [selectionRef, boundsWithPreview, geometry, committedPoseOf, layerIsPainted, adapter],\n );\n\n const helpers: CanvasViewHelpers<TPose> = {\n getEffectivePose: (id: string): TPose | null => {\n return previewPoseOf(id) ?? committedPoseOf(id);\n },\n getEffectiveBounds: boundsWithPreview,\n getGestureBounds: (): Bounds | null => {\n // The same id sets the ghost layer walks, so this cannot disagree with\n // what the user sees ghosted.\n const parts: (Bounds | null)[] = [];\n for (const id of new Set(gestureSource?.ids() ?? [])) parts.push(previewBoundsOf(id));\n const extraBounds = gestureSource?.bounds();\n if (extraBounds) for (const b of extraBounds) parts.push(b);\n return unionAABB(parts);\n },\n subscribeGestures: (fn: () => void): (() => void) =>\n gestureSource?.subscribe(fn) ?? noOpUnsubscribe,\n getGestureVersion: (): number => gestureSource?.getVersion() ?? 0,\n getChromeState: () => chromeState,\n getPreviewSources: (): readonly GesturePreviewSource[] => gestureSource?.previewSources() ?? [],\n getGestureOverlays: (): readonly OngoingOverlay[] => gestureSource?.overlays() ?? [],\n getIsVisible: (): ((id: string) => boolean) => getIsVisible?.() ?? alwaysVisible,\n };\n\n return { helpers };\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"useViewHelpers.js","names":[],"sources":["../../src/canvas/useViewHelpers.ts"],"sourcesContent":["import { useCallback, useMemo } from 'react';\nimport { framedBounds } from 'core/geometry/poseDescriptor';\nimport { useLatest } from '@weasel-js/react';\nimport type { GestureSource, GesturePreviewSource } from './gestureBounds';\nimport { useInFlightBounds } from './useInFlightBounds';\nimport type { OngoingOverlay } from '@weasel-js/routing';\nimport { unionAABB } from 'core/geometry/unionBounds';\nimport { buildChromeState, type ChromeState } from 'core/selection/chromeState';\nimport type { PoseDescriptor } from 'interactions/actions/resize/geometry';\nimport type { NodeId } from 'core/scene/types';\nimport type { DebugSink } from '../debug/types';\nimport type { Bounds } from 'core/viewport/fitViewToBounds';\nimport type { Scale2 } from '@weasel-js/geom';\nimport { drawnBoundsOf, type DrawnBoundsScene } from './drawnBounds';\n\nconst noOpUnsubscribe = (): void => {};\n\nconst alwaysVisible = (): boolean => true;\n\n/**\n * The half of {@link CanvasHelpers} that belongs to one view — everything\n * answered by a camera's own tools, gestures and selection. A canvas hosting\n * several viewports needs one of these per view; the surface half is shared.\n */\nexport interface CanvasViewHelpers<TPose> {\n /** Pose currently displayed for `id` — drag/resize/rotate overlay if active,\n * otherwise the committed pose from the adapter. Returns `null` if the id\n * isn't known. */\n getEffectivePose(id: string): TPose | null;\n /** Overlay-aware bounds for `id`. */\n getEffectiveBounds(id: string): Bounds | null;\n /**\n * World-space AABB of everything the in-flight gesture proposes — the\n * displaced poses of nodes being moved / resized / rotated / cloned, plus\n * any nascent insert that has no scene node yet. `null` when no gesture is\n * in flight.\n *\n * This reports the *gesture*, not the document: committed content the\n * gesture isn't touching is excluded. Select-only gestures are excluded\n * too: a marquee or lasso has geometry but proposes no content.\n *\n * The result is a plain AABB — never rotated. Rotated parts are folded in\n * by their rotated extent.\n */\n getGestureBounds(): Bounds | null;\n /**\n * Subscribe to the gesture layer's change signal, for everything on this\n * object that moves during a drag (`getEffectivePose`, `getEffectiveBounds`,\n * `getGestureBounds`). Returns an unsubscribe.\n *\n * Fires once per dispatcher pump: gesture start, every pointermove that\n * reaches an in-flight handle, end, and cancel — plus UI-driven ongoing\n * actions. It fires on the pump, not on a diff: a pump that changed nothing\n * observable still notifies, so don't hang expensive work directly off the\n * callback.\n *\n * It does **not** cover committed scene edits (subscribe to the scene for\n * those) or previews a consumer's own tool publishes from React state.\n * Without a gesture source wired — a bare `<Canvas>` — it never fires.\n */\n subscribeGestures(fn: () => void): () => void;\n /**\n * Monotonic counter bumped on exactly the events `subscribeGestures` fires\n * on. Pair the two for `useSyncExternalStore`:\n *\n * ```ts\n * const gestureVersion = useSyncExternalStore(\n * useCallback((cb) => helpersRef.current?.subscribeGestures(cb) ?? (() => {}), []),\n * () => helpersRef.current?.getGestureVersion() ?? 0,\n * );\n * ```\n *\n * Starts at 0 and only increases. `0` is also what a bare `<Canvas>` with\n * no gesture source reports, forever.\n */\n getGestureVersion(): number;\n /** The live ChromeState built once per render: overlay-aware selection\n * state for affordances and custom layers. */\n getChromeState(): ChromeState;\n /**\n * Everything publishing an in-flight preview for this view: the handles in\n * flight on its dispatcher, in dispatch order. Readers take the first\n * non-null answer per id.\n *\n * A ghost layer must read this off its draw envelope rather than close over\n * a dispatcher: one layer array paints every view, so a closure ghosts view\n * zero's drag into every panel.\n */\n getPreviewSources(): readonly GesturePreviewSource[];\n /** Overlay shapes this view's in-flight handles publish — marquee, lasso,\n * insert preview, raw commands. Same envelope rule as\n * {@link CanvasViewHelpers.getPreviewSources}. */\n getGestureOverlays(): readonly OngoingOverlay[];\n /**\n * Chrome-caps visibility predicate, keyed by chrome id. Overlay layers and\n * affordances call it per element to decide whether to draw / hit-test.\n * Unwired, it is the universal `() => true`.\n */\n getIsVisible(): (id: string) => boolean;\n}\n\n/**\n * The half of {@link CanvasHelpers} that belongs to the surface — one GL\n * context, one debug sink, however many views are drawn on it.\n */\nexport interface CanvasSurfaceHelpers {\n /** Active debug sink, when `<Canvas debug=...>` is enabled, for layers to\n * call from their `draw` callback. `null` when debug is off. */\n getDebug(): DebugSink | null;\n}\n\n/** Live overlay-aware lookups exposed to custom layers via `helpersRef`, and\n * what a layer receives as its `data` argument. */\nexport interface CanvasHelpers<TPose> extends CanvasViewHelpers<TPose>, CanvasSurfaceHelpers {\n /**\n * The view this draw is for: a `<CanvasView>` id, or `null` for the\n * surface's own camera. One layer array paints every view, so a layer that\n * belongs in some views and not others — a minimap's indicator — declines\n * the rest by this id.\n */\n readonly viewId: string | null;\n}\n\n/** What a view's pose and bounds lookups read of an adapter. */\nexport interface ViewPoseAdapter<TPose> {\n getPose(id: string): TPose;\n /** Where the node is drawn, when the adapter composes poses. An adapter\n * without it stores absolute poses, where the two agree. */\n getWorldPose?(id: string): TPose;\n /** Where `id` is drawn if it stores `stored`. An adapter without it stores\n * absolute poses. */\n worldOfStored?(id: string, stored: TPose): TPose;\n /** The node an id names, whose `layer` decides whether a view that hides\n * that layer shows its selection chrome. */\n getNode?(id: string): { layer?: string } | undefined;\n}\n\nexport interface UseViewHelpersOpts<TPose> {\n adapter: ViewPoseAdapter<TPose> | undefined;\n geometry: PoseDescriptor<TPose>;\n /** Consumer-supplied bounds resolver. Falls back to the adapter's pose. */\n boundsOf: ((id: string) => Bounds | null) | undefined;\n /** Bounds of `id` drawn at an in-flight `pose`. Falls back to the\n * geometry's box of that pose, which is wrong wherever the surface draws a\n * node somewhere its pose does not say — a parallax plane. */\n boundsOfPose?: ((id: string, pose: TPose) => Bounds | null) | undefined;\n /** The nodes the adapter's ids name: with them, the fallbacks box each as\n * drawn, stroke included, rather than by its pose. */\n nodes?: DrawnBoundsScene | undefined;\n /** The view's scale, which a screen-pixel stroke is resolved at. Default 1. */\n getScale?: (() => Scale2) | undefined;\n /** The ids selected, read whenever chrome asks: a view following another\n * reads that view's, which changes without this one rendering. */\n selection: () => readonly NodeId[];\n gestureSource: GestureSource | undefined;\n /** The dispatcher's preview pose for an id, read through a ref so a change\n * mid-gesture doesn't rebuild the memos that depend on it. */\n previewPoseExtra: ((id: string) => unknown) | undefined;\n /** Chrome-caps predicate for this view. Absent means everything is visible. */\n getIsVisible?: (() => (id: string) => boolean) | undefined;\n /** Whether a scene layer reaches the screen in this view. Absent means\n * every layer the scene shows does. */\n layerIsPainted?: ((layerId: string) => boolean) | undefined;\n}\n\nexport interface ViewHelpersBundle<TPose> {\n helpers: CanvasViewHelpers<TPose>;\n}\n\nfunction worldPoseOf<TPose>(adapter: ViewPoseAdapter<TPose>, id: string): TPose {\n return typeof adapter.getWorldPose === 'function' ? adapter.getWorldPose(id) : adapter.getPose(id);\n}\n\n/**\n * Build one view's overlay-aware state: its chrome and the lookups its layers\n * draw and hit-test against. A canvas with N views mounts N components each\n * calling this once.\n */\nexport function useViewHelpers<TPose>(\n opts: UseViewHelpersOpts<TPose>,\n): ViewHelpersBundle<TPose> {\n const {\n adapter, geometry, boundsOf, boundsOfPose, nodes, getScale, selection, gestureSource,\n previewPoseExtra, getIsVisible, layerIsPainted,\n } = opts;\n const getScaleRef = useLatest(getScale);\n const poseBoxOf = useCallback((id: string, pose: TPose): Bounds => {\n if (!nodes) return framedBounds(pose, geometry);\n const scale = getScaleRef.current?.();\n return drawnBoundsOf(nodes, id as NodeId, pose, {\n descriptor: geometry as PoseDescriptor<unknown>,\n ...(adapter ? { worldPoseOf: (m: NodeId) => worldPoseOf(adapter, m) } : {}),\n ...(scale ? { scale } : {}),\n });\n }, [nodes, geometry, adapter, getScaleRef]);\n const boxOf = useCallback(\n (id: string, pose: TPose): Bounds | null =>\n (boundsOfPose ? boundsOfPose(id, pose) : poseBoxOf(id, pose)),\n [boundsOfPose, poseBoxOf],\n );\n\n const baseBoundsOf = useMemo(() => {\n if (boundsOf) return boundsOf;\n if (!adapter) return undefined;\n return (id: string): Bounds | null => {\n try {\n // World: chrome is drawn over the picture, so it has to agree with\n // where the renderer put the node, not with where its pose is stored.\n return poseBoxOf(id, worldPoseOf(adapter, id));\n } catch {\n return null;\n }\n };\n }, [boundsOf, adapter, poseBoxOf]);\n\n const committedPoseOf = useCallback((id: string): TPose | null => {\n if (!adapter) return null;\n try {\n return worldPoseOf(adapter, id);\n } catch {\n return null;\n }\n }, [adapter]);\n\n const selectionRef = useLatest(selection);\n\n const effectiveBoundsOf = useMemo(() => boundsOf ?? baseBoundsOf, [boundsOf, baseBoundsOf]);\n const worldOfStored = useMemo(\n () => (adapter?.worldOfStored ? (id: string, stored: TPose) => adapter.worldOfStored!(id, stored) : undefined),\n [adapter],\n );\n const { previewPoseOf, previewBoundsOf } = useInFlightBounds({\n gestureSource, previewPoseExtra, boxOf, committedPoseOf, worldOfStored,\n });\n\n /**\n * Bounds for `id` with any in-flight gesture folded in — what the user can\n * see, not what is committed. Both the chrome state and the layer helpers\n * answer bounds questions with this, so resize handles cannot end up a frame\n * away from the shape they belong to.\n */\n const boundsWithPreview = useCallback((id: string): Bounds | null => {\n const previewed = previewBoundsOf(id);\n if (previewed) return previewed;\n return effectiveBoundsOf ? effectiveBoundsOf(id) : null;\n }, [previewBoundsOf, effectiveBoundsOf]);\n\n const chromeState: ChromeState = useMemo(\n () => buildChromeState({\n get selection() { return selectionRef.current(); },\n get multiActive() { return selectionRef.current().length > 1; },\n effectiveBoundsOf: boundsWithPreview,\n modifiers: { alt: false, shift: false, meta: false, ctrl: false },\n // Absent adapter / unknown ids fall back to `true` so the affordance\n // stays visible for consumers that wire bounds without an adapter.\n canRotate: (id) => {\n if (!geometry.supportsRotation) return true;\n const pose = committedPoseOf(id);\n if (pose == null) return true;\n return geometry.supportsRotation(pose);\n },\n ...(layerIsPainted ? { layerIsPainted } : {}),\n ...(adapter?.getNode ? { layerOf: (id: string) => adapter.getNode?.(id)?.layer } : {}),\n }),\n [selectionRef, boundsWithPreview, geometry, committedPoseOf, layerIsPainted, adapter],\n );\n\n const helpers: CanvasViewHelpers<TPose> = {\n getEffectivePose: (id: string): TPose | null => {\n return previewPoseOf(id) ?? committedPoseOf(id);\n },\n getEffectiveBounds: boundsWithPreview,\n getGestureBounds: (): Bounds | null => {\n // The same id sets the ghost layer walks, so this cannot disagree with\n // what the user sees ghosted.\n const parts: (Bounds | null)[] = [];\n for (const id of new Set(gestureSource?.ids() ?? [])) parts.push(previewBoundsOf(id));\n const extraBounds = gestureSource?.bounds();\n if (extraBounds) for (const b of extraBounds) parts.push(b);\n return unionAABB(parts);\n },\n subscribeGestures: (fn: () => void): (() => void) =>\n gestureSource?.subscribe(fn) ?? noOpUnsubscribe,\n getGestureVersion: (): number => gestureSource?.getVersion() ?? 0,\n getChromeState: () => chromeState,\n getPreviewSources: (): readonly GesturePreviewSource[] => gestureSource?.previewSources() ?? [],\n getGestureOverlays: (): readonly OngoingOverlay[] => gestureSource?.overlays() ?? [],\n getIsVisible: (): ((id: string) => boolean) => getIsVisible?.() ?? alwaysVisible,\n };\n\n return { helpers };\n}\n"],"mappings":"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"}
|
|
@@ -2,7 +2,7 @@ import { createSceneLayerGate } from "./sceneLayerPaint.js";
|
|
|
2
2
|
import { useCallback, useState } from "react";
|
|
3
3
|
import { useLatest } from "@weasel-js/react";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/canvas/useViewLayerGate.ts
|
|
6
6
|
/**
|
|
7
7
|
* Whether a surface's own view paints a scene layer, judged against the stack
|
|
8
8
|
* `surfaceLayers` returns, read at ask time, so a consumer slot anchored
|
|
@@ -24,6 +24,5 @@ function useViewLayerGate(layerVisibility, layerOrder, surfaceLayers) {
|
|
|
24
24
|
return layerVisibility !== void 0 || layerOrder !== void 0 ? layerIsPainted : void 0;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
//#endregion
|
|
28
27
|
export { useViewLayerGate };
|
|
29
28
|
//# sourceMappingURL=useViewLayerGate.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createSceneLayerGate, viewPaintedLayers } from "./sceneLayerPaint.js";
|
|
2
2
|
import { useCallback, useRef, useState } from "react";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/canvas/useViewNesting.ts
|
|
5
5
|
/**
|
|
6
6
|
* How a `<CanvasView>` sits in the view it is nested in: the frame its
|
|
7
7
|
* `bounds` and derived camera are measured against, and the layers it may
|
|
@@ -127,6 +127,5 @@ function useViewNesting(registry, live) {
|
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
//#endregion
|
|
131
130
|
export { NO_RECT, sizeOf, useViewNesting };
|
|
132
131
|
//# sourceMappingURL=useViewNesting.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect } from "react";
|
|
2
2
|
import { useLatest } from "@weasel-js/react";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/canvas/useViewRegistrySurface.ts
|
|
5
5
|
/**
|
|
6
6
|
* Attach this canvas to the view registry as its surface. The stack a view paints through its
|
|
7
7
|
* own camera is this canvas's `layers`, before the views themselves are folded in — otherwise
|
|
@@ -41,6 +41,5 @@ function useViewRegistrySurface(viewRegistry, layers, frame, services) {
|
|
|
41
41
|
]);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
//#endregion
|
|
45
44
|
export { useViewRegistrySurface };
|
|
46
45
|
//# sourceMappingURL=useViewRegistrySurface.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createContext, useContext } from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/canvas/viewInputs.tsx
|
|
5
5
|
var ViewInputsContext = createContext(null);
|
|
6
6
|
/** @internal */
|
|
7
7
|
function ViewInputsProvider({ value, children }) {
|
|
@@ -15,6 +15,5 @@ function useOptionalViewInputs() {
|
|
|
15
15
|
return useContext(ViewInputsContext);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
//#endregion
|
|
19
18
|
export { ViewInputsProvider, useOptionalViewInputs };
|
|
20
19
|
//# sourceMappingURL=viewInputs.js.map
|
|
@@ -2,7 +2,7 @@ import { aimSpace2d } from "../domains/viewports/aim.js";
|
|
|
2
2
|
import { createViewMarkerLayer, grabViewMarker } from "../domains/viewports/viewMarker.js";
|
|
3
3
|
import { layerAffordance } from "./affordanceAt.js";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/canvas/viewMarkers.ts
|
|
6
6
|
/** @internal */
|
|
7
7
|
function createViewMarkerRegistry(markers, deps) {
|
|
8
8
|
let gate = null;
|
|
@@ -58,6 +58,5 @@ function createViewMarkerRegistry(markers, deps) {
|
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
//#endregion
|
|
62
61
|
export { createViewMarkerRegistry };
|
|
63
62
|
//# sourceMappingURL=viewMarkers.js.map
|
|
@@ -6,7 +6,7 @@ import { createEmitter } from "@weasel-js/registry";
|
|
|
6
6
|
import { createContext, useContext, useMemo, useRef } from "react";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// src/canvas/viewRegistry.tsx
|
|
10
10
|
/**
|
|
11
11
|
* The seam between a canvas surface and the views drawn on it.
|
|
12
12
|
*
|
|
@@ -186,6 +186,5 @@ var IDENTITY_VIEW = {
|
|
|
186
186
|
}
|
|
187
187
|
};
|
|
188
188
|
|
|
189
|
-
//#endregion
|
|
190
189
|
export { IDENTITY_VIEW, UNMEASURED_DIMS, ViewRegistryProvider, surfaceLocal, useOptionalViewRegistry };
|
|
191
190
|
//# sourceMappingURL=viewRegistry.js.map
|
package/dist/canvas/viewSnap.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { sameView } from "../core/viewport/view.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/canvas/viewSnap.ts
|
|
4
4
|
/** A move within this of a whole device pixel is one: the renderer's own slack. */
|
|
5
5
|
var SLACK = 1e-4;
|
|
6
6
|
/**
|
|
@@ -62,6 +62,5 @@ function whole(n) {
|
|
|
62
62
|
return Math.abs(n - Math.round(n)) <= SLACK;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
//#endregion
|
|
66
65
|
export { ViewSnap };
|
|
67
66
|
//# sourceMappingURL=viewSnap.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/canvas/watchElementMove.ts
|
|
2
2
|
/**
|
|
3
3
|
* Call `onMove` when `element`'s box moves in the viewport for a reason no
|
|
4
4
|
* event reports: a sibling collapsing, content loading above it. A scroll or a
|
|
@@ -76,6 +76,5 @@ function watchElementMove(element, onMove) {
|
|
|
76
76
|
return stop;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
//#endregion
|
|
80
79
|
export { watchElementMove };
|
|
81
80
|
//# sourceMappingURL=watchElementMove.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { wrapWithPoseRotation } from "./poseRotation.js";
|
|
2
2
|
import { overChildren, splitOverChildren } from "./overChildren.js";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/canvas/wrapNodeOutput.ts
|
|
5
5
|
/** Rotate `cmds` about the pose's AABB center and multiply by `alpha`.
|
|
6
6
|
* Both wraps are skipped when they would be no-ops (zero/absent rotation,
|
|
7
7
|
* alpha exactly 1, empty command list), so an upright opaque node emits the
|
|
@@ -21,6 +21,5 @@ function wrapPart(cmds, pose, alpha) {
|
|
|
21
21
|
return rotated;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
//#endregion
|
|
25
24
|
export { wrapNodeOutput };
|
|
26
25
|
//# sourceMappingURL=wrapNodeOutput.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/core/adapters/testing/rootsTree.ts
|
|
2
2
|
/** The tree of a fake adapter whose nodes never nest: every id in `order` is a root, bottom
|
|
3
3
|
* first. `setChildOrder` rewrites `order` in place. */
|
|
4
4
|
function rootsTree(order = [], nodeOf = () => void 0) {
|
|
@@ -12,6 +12,5 @@ function rootsTree(order = [], nodeOf = () => void 0) {
|
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
//#endregion
|
|
16
15
|
export { rootsTree };
|
|
17
16
|
//# sourceMappingURL=rootsTree.js.map
|
package/dist/core/applyOps.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/core/applyOps.ts
|
|
2
2
|
/**
|
|
3
3
|
* Default `applyOps` implementation: apply each op in order against
|
|
4
4
|
* `adapter`. Used by hooks when an adapter omits `applyOps`. Apps that
|
|
@@ -23,6 +23,5 @@ function dispatchApplyBatch(adapter, ops, label) {
|
|
|
23
23
|
else applyOpsTo(adapter, ops, label);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
//#endregion
|
|
27
26
|
export { applyOpsTo, dispatchApplyBatch };
|
|
28
27
|
//# sourceMappingURL=applyOps.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/core/device/targets.ts
|
|
2
2
|
/**
|
|
3
3
|
* Base sizes for grabbable chrome, in CSS pixels at `targetScale = 1`, and the
|
|
4
4
|
* one accessor that resolves them for a live pointer type.
|
|
@@ -33,6 +33,5 @@ function targetSizesPx(targetScale = 1, base = {}) {
|
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
//#endregion
|
|
37
36
|
export { ANCHOR_HIT_BASE_PX, HANDLE_BASE_PX, ROTATION_HANDLE_BASE_PX, targetSizesPx };
|
|
38
37
|
//# sourceMappingURL=targets.js.map
|
|
@@ -2,7 +2,7 @@ import { watchDevicePixelRatio } from "./watchDevicePixelRatio.js";
|
|
|
2
2
|
import { createContext, createElement, useContext, useEffect, useMemo, useState } from "react";
|
|
3
3
|
import { DEFAULT_DEVICE_PROFILE, resolveDeviceProfile } from "@weasel-js/routing";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/core/device/useDeviceProfile.ts
|
|
6
6
|
var COARSE_QUERY = "(pointer: coarse)";
|
|
7
7
|
var HOVER_QUERY = "(hover: hover)";
|
|
8
8
|
function hasMatchMedia() {
|
|
@@ -98,6 +98,5 @@ function DeviceProfileProvider({ value, children }) {
|
|
|
98
98
|
return createElement(DeviceProfileContext.Provider, { value: profile }, children);
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
//#endregion
|
|
102
101
|
export { DeviceProfileProvider, useDeviceProfile };
|
|
103
102
|
//# sourceMappingURL=useDeviceProfile.js.map
|