@weasel-js/core 0.8.0 → 1.0.0
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 +413 -0
- package/dist/{DrawCommand-BKJ5JPkC.d.ts → DrawCommand-DCmiNkBj.d.ts} +14 -169
- package/dist/{chunk-GLZLSPGJ.js → chunk-6SHZHXXR.js} +46 -9
- package/dist/chunk-6SHZHXXR.js.map +1 -0
- package/dist/{chunk-DLV5F4NY.js → chunk-D2C6K6FO.js} +915 -547
- package/dist/chunk-D2C6K6FO.js.map +1 -0
- package/dist/chunk-DCIU3SRK.js +505 -0
- package/dist/chunk-DCIU3SRK.js.map +1 -0
- package/dist/chunk-IO5Z75X4.js +167 -0
- package/dist/chunk-IO5Z75X4.js.map +1 -0
- package/dist/{chunk-BPRHGTLQ.js → chunk-UB6A6L77.js} +3 -3
- package/dist/{chunk-BPRHGTLQ.js.map → chunk-UB6A6L77.js.map} +1 -1
- package/dist/{chunk-CMBE45MT.js → chunk-Z3KNFTTS.js} +6 -6
- package/dist/chunk-Z3KNFTTS.js.map +1 -0
- package/dist/{index-Clf_koyR.d.ts → index-ChM3ZJ2v.d.ts} +103 -90
- package/dist/index.d.ts +313 -32
- package/dist/index.js +6 -6
- package/dist/insert.js +5 -5
- package/dist/insert.js.map +1 -1
- package/dist/move.js +2 -2
- package/dist/paint-types-CnLIzqq1.d.ts +261 -0
- package/dist/patterns-builtin.d.ts +57 -2
- package/dist/patterns-builtin.js +1 -97
- package/dist/patterns-builtin.js.map +1 -1
- package/dist/renderer.d.ts +24 -7
- package/dist/renderer.js +6 -6
- package/dist/resize.js +2 -2
- package/dist/routing.d.ts +4 -4
- package/dist/routing.js +1 -1
- package/dist/{viewToMat3-DFMdZvVl.d.ts → viewToMat3-BvaWCN99.d.ts} +1 -1
- package/package.json +6 -6
- package/dist/chunk-6DAUIMTO.js +0 -233
- package/dist/chunk-6DAUIMTO.js.map +0 -1
- package/dist/chunk-CMBE45MT.js.map +0 -1
- package/dist/chunk-DLV5F4NY.js.map +0 -1
- package/dist/chunk-GLZLSPGJ.js.map +0 -1
- package/dist/chunk-Y52N27PF.js +0 -39
- package/dist/chunk-Y52N27PF.js.map +0 -1
- package/dist/registerTexture-BzHTLhD9.d.ts +0 -25
package/dist/index.d.ts
CHANGED
|
@@ -4,10 +4,10 @@ import { a as ViewTransform, V as View, Z as ZoomBound, b as ZoomFactor } from '
|
|
|
4
4
|
export { s as screenToWorld, v as viewToTransform, w as worldToScreen } from './view-DSQgxBJB.js';
|
|
5
5
|
import { a as UnitValue, b as UnitSystem, U as UseMoveOptions, O as OriginProjection } from './grid-XcFQVS0f.js';
|
|
6
6
|
export { I as IMPERIAL_INCHES, M as METRIC_MM, P as PIXELS, R as RECT_ORIGIN_PROJECTION, c as Unit, f as formatUnit, g as gridSnapStrategy, p as pointToGridCell, r as resolveUnit } from './grid-XcFQVS0f.js';
|
|
7
|
-
import { R as RenderLayer, D as Dims, a as DeviceProfile, b as DetectedDeviceFacts, C as Condition, c as Rule, d as RuleCtx, V as VisibilityRules, e as ChromeCtx, f as ChromeId, A as Action, g as DepSchema, S as SliceDep, h as ActionsRegistry, T as Tool, i as AffordanceHit, j as Dispatcher, k as AnyTool, l as ToolCtx, m as ToolKeybinding, H as HotkeyTrigger,
|
|
8
|
-
export {
|
|
9
|
-
import {
|
|
10
|
-
export {
|
|
7
|
+
import { R as RenderLayer, D as Dims, a as DeviceProfile, b as DetectedDeviceFacts, C as Condition, c as Rule, d as RuleCtx, V as VisibilityRules, e as ChromeCtx, f as ChromeId, A as Action, g as DepSchema, S as SliceDep, h as ActionsRegistry, T as Tool, i as AffordanceHit, j as Dispatcher, k as AnyTool, l as ToolCtx, m as ToolKeybinding, H as HotkeyTrigger, L as LayerHit, n as ChromeState, o as SelectionApi, I as InsertExtras, G as GeometryProjection, p as ContentHandlerEntry, q as SvgIngestOptions, U as UseSelectionOptions, r as ActionsProp, s as Affordance, t as AffordanceBinding, u as AffordanceRegion, v as CommonAffordanceScratch, B as BooleansAdapter, E as Eligibility, w as BindingScope, x as Contribution, y as ScopedBinding } from './index-ChM3ZJ2v.js';
|
|
8
|
+
export { z as ALWAYS, F as ActionDeps, J as ActionDisabledReason, K as ActionEnabledResult, M as ActionEntry, N as ActionsProvider, O as ActiveToolContextProvider, P as ActiveToolContextProviderIfRoot, Q as ActiveToolContextProviderProps, W as ActiveToolContextValue, X as AreaSelectDep, Y as BindingOpts, Z as BooleanOp, _ as BooleanOpResult, $ as BoundGesture, a0 as BuildRuleCtxArgs, a1 as ClaimableGesture, a2 as ClipboardDep, a3 as ClipboardIngestCtx, a4 as CustomPaintContext, a5 as DepName, a6 as DepRegistry, a7 as DepRegistryProvider, a8 as DispatcherContext, a9 as DragSample, aa as EditAnchorsDep, ab as GestureBinding, ac as IDENTITY_POSE_COMPOSITION, ad as ImmediateInvoker, ae as IngestCtx, af as IngestionDep, ag as InsertDep, ah as InvocationCtx, ai as Invoker, aj as LassoSelectDep, ak as LayoutDep, al as MatchResult, am as NEVER, an as NodeAtPointDep, ao as OngoingHandle, ap as OngoingInvoker, aq as OngoingOverlay, ar as Point2, as as PointerContextProvider, at as PointerContextValue, au as PointerWorldPos, av as PoseAdapter, aw as PoseComposition, ax as ResizePolicy, ay as ResolveAllOptions, az as ResolveOnlyResult, aA as ResolvedCandidate, aB as SelectionExtendKey, aC as SelectionMode, aD as Selector, aE as SnapDep, aF as SvgUnpacker, aG as TextEditDep, aH as ToolModifiers, aI as ToolPresentation, aJ as ToolSlot, aK as UiOngoingControl, aL as ViewApi, aM as applyBooleanOp, aN as buildRuleCtx, aO as clipboardCopyAction, aP as clipboardCutAction, aQ as composeRectPose, aR as composeWorldPose, aS as createDispatcher, aT as decomposeRectPose, aU as describeRule, aV as drawLayers, aW as enterTextEditAction, aX as evaluate, aY as evaluateEnabled, aZ as rebaseLocalPose, a_ as registerContentHandler, a$ as routing, b0 as sliceAction, b1 as specificity, b2 as translateRectPose, b3 as useAction, b4 as useActionsRegistry, b5 as useActiveToolContext, b6 as useDepRegistry, b7 as useDepSource, b8 as useOptionalActiveToolContext, b9 as useOptionalDepRegistry, ba as usePointerContext, bb as useSelection, bc as worldPoseLookup } from './index-ChM3ZJ2v.js';
|
|
9
|
+
import { S as Stroke, F as FillStyle, a as TextureHandle, T as TilePatternSpec, b as GradientKind, G as GradStop, c as GradientFill } from './paint-types-CnLIzqq1.js';
|
|
10
|
+
export { d as GradientUnits, R as Region, e as StrokeAlign, f as alignedStrokeRect } from './paint-types-CnLIzqq1.js';
|
|
11
11
|
import { B as Bounds, P as PoseProjection, F as FitViewToBoundsOptions, V as ViewportDims } from './geometry-DVeZ2i-c.js';
|
|
12
12
|
export { R as RECT_POSE_DESCRIPTOR, a as ROTATED_POSE_DESCRIPTOR, f as fitViewToBounds } from './geometry-DVeZ2i-c.js';
|
|
13
13
|
import { N as NodeId, S as Scene, a as Node$1, b as SerializedScene, R as RectPose, U as UseSceneOptions, c as SceneRegistry, d as RegisteredOp } from './types-DUpI7Apc.js';
|
|
@@ -25,18 +25,19 @@ export { d as DebugFeature, H as HandleKind, e as HitShape, R as RecordedBounds,
|
|
|
25
25
|
import { a as PolygonPath, P as Path, b as PathFillRule, R as RectPath } from './path-B6MMiodD.js';
|
|
26
26
|
export { c as PATH_C, d as PATH_CMD_LENGTHS, e as PATH_L, f as PATH_M, g as PATH_Q, h as PATH_Z } from './path-B6MMiodD.js';
|
|
27
27
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
28
|
+
import { D as DrawCommand, S as ShaderProgramHandle, P as PathDrawCommand, d as StyledRun, R as ResolvedTextStyle, e as TextStyle, f as TextVerticalAlign } from './DrawCommand-DCmiNkBj.js';
|
|
29
|
+
export { g as DEFAULT_TEXT_STYLE, G as GroupDrawCommand, I as ImageDrawCommand, M as Mat3, h as ResolvedRun, a as ShaderDrawCommand, b as ShaderUniform, T as TextDrawCommand, i as fontString, j as markdownToRuns, k as resolveRuns, l as resolveTextStyle, n as runsToMarkdown, o as runsToPlainText, t as toRuns, v as verticalAlignOffset } from './DrawCommand-DCmiNkBj.js';
|
|
28
30
|
import { Op, CreateHistoryOptions, History } from '@weasel-js/history';
|
|
29
31
|
export * from '@weasel-js/history';
|
|
30
32
|
export { Op } from '@weasel-js/history';
|
|
31
|
-
import { T as TextureHandle } from './registerTexture-BzHTLhD9.js';
|
|
32
33
|
import { Mat3 } from '@weasel-js/geom';
|
|
33
34
|
import { G as Guide } from './types-D2tTKEU0.js';
|
|
34
35
|
export { U as UseInsertOptions } from './options-wAvCnOZd.js';
|
|
35
36
|
export { UseClipboardOpsOptions, UseClipboardOpsReturn, WEASEL_CLIPBOARD_MIME, WEASEL_CLIPBOARD_MIME_WEB, buildWeaselClipboardText, embedWeaselMetadataInSvg, extractWeaselClipboardFromSvg, parseWeaselClipboardText, sniffWeaselClipboardText, useClipboardOps } from './clipboard.js';
|
|
36
37
|
export { cloneByAltDrag } from './clone.js';
|
|
37
|
-
export { I as ImageMinification, v as viewToMat3 } from './viewToMat3-
|
|
38
|
+
export { I as ImageMinification, v as viewToMat3 } from './viewToMat3-BvaWCN99.js';
|
|
38
39
|
export { FontVariant, LocalFontOutlinesResult, OutlineFontStyle, OutlineSource, OutlineStatus, OutlineVariant, canQueryLocalFonts, enableLocalFontOutlines, hasFontOutlines, isCanvasFont, listFontOutlines, outlineStatus, registerCanvasFont, registerFont, registerFontOutlines, subscribeGlyphReady, unregisterCanvasFont, unregisterFontOutlines } from '@weasel-js/font';
|
|
39
|
-
import '@weasel-js/modes';
|
|
40
|
+
import { CapabilityTag } from '@weasel-js/modes';
|
|
40
41
|
|
|
41
42
|
/**
|
|
42
43
|
* The kit version a build was compiled from, so an app can report what it is
|
|
@@ -532,21 +533,66 @@ interface UsePointerStylusOptions {
|
|
|
532
533
|
declare function usePointerStylus(target?: RefObject<HTMLElement | null> | HTMLElement | null, options?: UsePointerStylusOptions): PointerStylusState;
|
|
533
534
|
|
|
534
535
|
/**
|
|
535
|
-
* Geometric mean of a per-axis scale.
|
|
536
|
-
*
|
|
537
|
-
* Degenerates to `s.x` (or `s.y`) when the two axes are equal; otherwise
|
|
538
|
-
* sits between them.
|
|
536
|
+
* Geometric mean of a per-axis scale. Degenerates to `s.x` (or `s.y`) when the
|
|
537
|
+
* two axes are equal; otherwise sits between them.
|
|
539
538
|
*
|
|
540
|
-
*
|
|
541
|
-
*
|
|
542
|
-
*
|
|
543
|
-
*
|
|
539
|
+
* **Not for hit-testing.** A screen-pixel length is not one world distance
|
|
540
|
+
* under non-uniform zoom, and collapsing it to a scalar makes a pickable
|
|
541
|
+
* region too generous on one axis and too mean on the other. Use `pxExtent`
|
|
542
|
+
* for a per-axis world length, or `withinPxBox` / `withinPxRadius` to compare
|
|
543
|
+
* in screen space directly. Chrome hit-tests moved off this in 2026-08.
|
|
544
|
+
*
|
|
545
|
+
* What legitimately remains: hairline stroke widths (`1 / meanScale`), where
|
|
546
|
+
* a single width is all the renderer accepts and no per-axis answer exists,
|
|
547
|
+
* and painted chrome placement, whose per-axis form doesn't separate under a
|
|
548
|
+
* rotated target.
|
|
544
549
|
*/
|
|
545
550
|
declare function meanScale(s: {
|
|
546
551
|
x: number;
|
|
547
552
|
y: number;
|
|
548
553
|
}): number;
|
|
549
554
|
|
|
555
|
+
/**
|
|
556
|
+
* Screen-pixel lengths in world units, per axis.
|
|
557
|
+
*
|
|
558
|
+
* Chrome declares its hit zones in screen pixels — an 8px handle stays 8px at
|
|
559
|
+
* every zoom, because it paints in screen space. Converting one such length to
|
|
560
|
+
* world units with a single scalar (see `meanScale`) is exact only under
|
|
561
|
+
* uniform zoom; per-axis it is too generous on one axis and too mean on the
|
|
562
|
+
* other, so the pickable region stops matching the painted one.
|
|
563
|
+
*
|
|
564
|
+
* Prefer {@link withinPxBox} / {@link withinPxRadius}, which compare in screen
|
|
565
|
+
* space and so can't drift from the paint at all. {@link pxExtent} is for the
|
|
566
|
+
* cases that must stay in world units — a tolerance handed to geometry that
|
|
567
|
+
* doesn't know about the view.
|
|
568
|
+
*/
|
|
569
|
+
interface Scale2 {
|
|
570
|
+
x: number;
|
|
571
|
+
y: number;
|
|
572
|
+
}
|
|
573
|
+
/** One screen-pixel length as world-space extents, per axis. */
|
|
574
|
+
declare function pxExtent(px: number, scale: Scale2): {
|
|
575
|
+
x: number;
|
|
576
|
+
y: number;
|
|
577
|
+
};
|
|
578
|
+
/** World delta → screen delta. Only the scale participates: translation
|
|
579
|
+
* cancels in a difference, and the kit's views carry no skew. */
|
|
580
|
+
declare function scaleDelta(dx: number, dy: number, scale: Scale2): {
|
|
581
|
+
x: number;
|
|
582
|
+
y: number;
|
|
583
|
+
};
|
|
584
|
+
/**
|
|
585
|
+
* Is a world-space delta inside a screen-space square of half-extent `px`?
|
|
586
|
+
*
|
|
587
|
+
* The square is axis-aligned **on screen**, which is what a handle painted in
|
|
588
|
+
* screen space actually is — so this stays true under non-uniform zoom and
|
|
589
|
+
* under a rotated target, where an axis-aligned world-space test is a rotated
|
|
590
|
+
* rectangle on screen.
|
|
591
|
+
*/
|
|
592
|
+
declare function withinPxBox(dx: number, dy: number, px: number, scale: Scale2): boolean;
|
|
593
|
+
/** Is a world-space delta inside a screen-space circle of radius `px`? */
|
|
594
|
+
declare function withinPxRadius(dx: number, dy: number, px: number, scale: Scale2): boolean;
|
|
595
|
+
|
|
550
596
|
/** A 2D point in the rect element's local coordinate space. */
|
|
551
597
|
interface HandleDragPoint {
|
|
552
598
|
x: number;
|
|
@@ -1824,9 +1870,6 @@ interface UseGestureDispatcherOptions {
|
|
|
1824
1870
|
actions: ActionsRegistry;
|
|
1825
1871
|
/** Tool definitions keyed by id. Typically passes an empty Map. */
|
|
1826
1872
|
toolsById: ReadonlyMap<string, Tool>;
|
|
1827
|
-
/** Ids (within `toolsById`) of always-on tools, whose bindings assemble at
|
|
1828
|
-
* ambient scope. See `DispatcherContext.ambientToolIds`. */
|
|
1829
|
-
ambientToolIds?: readonly string[];
|
|
1830
1873
|
/** Default true. Set false to opt out of dispatcher wiring (e.g. demos that disable it). */
|
|
1831
1874
|
enabled?: boolean;
|
|
1832
1875
|
/**
|
|
@@ -2119,10 +2162,9 @@ interface ToolsApi {
|
|
|
2119
2162
|
/**
|
|
2120
2163
|
* Manages the active tool and hotkey slot.
|
|
2121
2164
|
*
|
|
2122
|
-
*
|
|
2123
|
-
*
|
|
2124
|
-
*
|
|
2125
|
-
* the overlay roll-up.
|
|
2165
|
+
* A thin shim over {@link useContributions}: the `registry` / `ambient`
|
|
2166
|
+
* arguments are restated as declared eligibility (`focus` / `always`), and
|
|
2167
|
+
* assembly happens in one place for tools and non-tool contributions alike.
|
|
2126
2168
|
*
|
|
2127
2169
|
* Requires `<ActiveToolContextProvider>` (or `<WeaselProvider>` /
|
|
2128
2170
|
* `<SceneCanvas>`, which mount one internally) in scope: active/hotkey state
|
|
@@ -2131,8 +2173,8 @@ interface ToolsApi {
|
|
|
2131
2173
|
*
|
|
2132
2174
|
* **First-mount-wins semantics**: if `opts.active` differs from the context
|
|
2133
2175
|
* default (`'select'`) on first mount, `useTools` pushes `opts.active` to
|
|
2134
|
-
* the context
|
|
2135
|
-
*
|
|
2176
|
+
* the context. Subsequent mounts respect whatever the context currently
|
|
2177
|
+
* holds (the first caller wins).
|
|
2136
2178
|
*/
|
|
2137
2179
|
declare function useTools(opts: UseToolsOptions): ToolsApi;
|
|
2138
2180
|
|
|
@@ -2576,8 +2618,8 @@ interface UsePenToolOptions<TPose> {
|
|
|
2576
2618
|
* ⌘-click / double-click, producing a compound path. */
|
|
2577
2619
|
autoCommitOnClose?: boolean;
|
|
2578
2620
|
/** Screen-px hit radius for "click first anchor to close". Default `8`.
|
|
2579
|
-
*
|
|
2580
|
-
*
|
|
2621
|
+
* Measured as a screen-space circle, so it stays round under non-uniform
|
|
2622
|
+
* zoom; aligns with `useSelectTool.handleHitRadius`. */
|
|
2581
2623
|
closeHitRadius?: number;
|
|
2582
2624
|
/** Optional point snapper applied to every world-space coordinate the
|
|
2583
2625
|
* pen records or previews — anchor positions (corner clicks, smooth-
|
|
@@ -2903,13 +2945,15 @@ interface CanvasExtensionApi {
|
|
|
2903
2945
|
* `<SceneCanvas>` folds this into the `affordanceAt` thunk it hands the
|
|
2904
2946
|
* gesture dispatcher — ahead of the kit's own selection chrome, since
|
|
2905
2947
|
* registered layers draw on top — so a hit surfaces to actions as an
|
|
2906
|
-
* `AffordanceHit` with kind `layer:<id>` and the
|
|
2907
|
-
* as its `payload`.
|
|
2908
|
-
*
|
|
2948
|
+
* `AffordanceHit` with kind `layer:<id>` and the hit's `initialScratch`
|
|
2949
|
+
* as its `payload`. `owner` is set to the layer id, and `cursor` /
|
|
2950
|
+
* `strength` carry through from the hit when the layer sets them.
|
|
2951
|
+
* A layer's owner binds a `kindOf` predicate on that kind to claim the
|
|
2952
|
+
* gesture; see `@weasel-js/hud` for the worked example.
|
|
2909
2953
|
*/
|
|
2910
2954
|
hitTestExtras(worldX: number, worldY: number): {
|
|
2911
2955
|
layerId: string;
|
|
2912
|
-
|
|
2956
|
+
hit: LayerHit;
|
|
2913
2957
|
} | null;
|
|
2914
2958
|
/** Feed external content into the ingestion pipeline imperatively — the
|
|
2915
2959
|
* same content-handler registry that OS drop and clipboard paste hit.
|
|
@@ -6332,6 +6376,15 @@ interface UseTextEditOptions {
|
|
|
6332
6376
|
getText: (id: string) => string;
|
|
6333
6377
|
/** Read style for `id` (used for font setup on the overlay). */
|
|
6334
6378
|
getStyle: (id: string) => TextStyle | undefined;
|
|
6379
|
+
/**
|
|
6380
|
+
* Write style back for `id`. Optional; needed only to turn a flag **off**
|
|
6381
|
+
* inside a node whose own `TextStyle` sets it. Run flags are additive, so
|
|
6382
|
+
* that edit is expressed by lowering the node flag and raising it on the
|
|
6383
|
+
* runs outside the selection — which needs somewhere to put the new node
|
|
6384
|
+
* style. Without this, such a toggle is declined and nothing changes, as
|
|
6385
|
+
* before. See `runs/flagRange`.
|
|
6386
|
+
*/
|
|
6387
|
+
setStyle?: (id: string, style: TextStyle) => void;
|
|
6335
6388
|
/** Read screen-space pose for `id`. Called per frame while editing. */
|
|
6336
6389
|
getScreenPose: (id: string) => TextEditScreenPose | null;
|
|
6337
6390
|
/** Commit text. Caller wraps in op/undo. */
|
|
@@ -6509,6 +6562,57 @@ interface UseSceneTextEditReturn extends UseTextEditReturn {
|
|
|
6509
6562
|
}
|
|
6510
6563
|
declare function useSceneTextEdit<TData extends DefaultTextData, TLayer extends string, TPose extends RectPose = RectPose>(scene: Scene<TData, TLayer, TPose>, container: HTMLElement | null, options?: UseSceneTextEditOptions<TData>): UseSceneTextEditReturn;
|
|
6511
6564
|
|
|
6565
|
+
/**
|
|
6566
|
+
* Turning a run-level flag **off** inside a node that sets it.
|
|
6567
|
+
*
|
|
6568
|
+
* Run flags are additive over the node's `TextStyle` — a run turns `bold` /
|
|
6569
|
+
* `italic` / `underline` / `strikethrough` on, never off (see the contract at
|
|
6570
|
+
* the top of `rangeStyle.ts`). So "select a word inside an underlined node and
|
|
6571
|
+
* hit U" is unrepresentable by the stored shape, and the character bar can
|
|
6572
|
+
* only refuse.
|
|
6573
|
+
*
|
|
6574
|
+
* This resolves it by rewriting rather than by widening the model: clear the
|
|
6575
|
+
* flag on the node, and set it on every run *outside* the range. The rendered
|
|
6576
|
+
* result is identical and the edit becomes expressible, with `StyledRun`
|
|
6577
|
+
* unchanged — so nothing a document can already contain changes meaning, which
|
|
6578
|
+
* matters while the flags are heading for a persisted format.
|
|
6579
|
+
*
|
|
6580
|
+
* The alternative was a tri-state run flag (`true` / `false` / inherit). It
|
|
6581
|
+
* cannot cover `bold` or `italic`: those are booleans on a run but
|
|
6582
|
+
* `fontWeight` and `fontStyle` on the node, so a run's `false` has no node-level
|
|
6583
|
+
* boolean to override. Tri-state fixes two of the four flags; this fixes all
|
|
6584
|
+
* four.
|
|
6585
|
+
*/
|
|
6586
|
+
|
|
6587
|
+
/** The additive run flags. */
|
|
6588
|
+
type FlagKey = 'bold' | 'italic' | 'underline' | 'strikethrough';
|
|
6589
|
+
interface SetFlagResult {
|
|
6590
|
+
runs: StyledRun[];
|
|
6591
|
+
style: TextStyle;
|
|
6592
|
+
/**
|
|
6593
|
+
* False when the node flag could not be lowered without changing what is
|
|
6594
|
+
* drawn, and nothing was written. The only case is a `fontWeight` the run
|
|
6595
|
+
* boolean cannot express: `run.bold` resolves to exactly 700 everywhere, so
|
|
6596
|
+
* a node at 900 cannot have its weight pushed onto its runs. Callers should
|
|
6597
|
+
* disable the control rather than apply a silent downgrade.
|
|
6598
|
+
*/
|
|
6599
|
+
applied: boolean;
|
|
6600
|
+
}
|
|
6601
|
+
/** Does the node style carry this flag? */
|
|
6602
|
+
declare function nodeHasFlag(style: TextStyle, key: FlagKey): boolean;
|
|
6603
|
+
/**
|
|
6604
|
+
* Set `key` to `value` over `[start, end)`.
|
|
6605
|
+
*
|
|
6606
|
+
* Turning a flag **on**, or off in a node that doesn't set it, is the ordinary
|
|
6607
|
+
* additive write and leaves `style` alone. Turning it off in a node that *does*
|
|
6608
|
+
* set it takes the rewrite: the node flag is cleared and the flag is written
|
|
6609
|
+
* onto the complement of the range.
|
|
6610
|
+
*
|
|
6611
|
+
* `runs` is normalized on every path, so the complement collapses back to one
|
|
6612
|
+
* run when the range is empty and the whole array coalesces as usual.
|
|
6613
|
+
*/
|
|
6614
|
+
declare function setFlagOverRange(runs: readonly StyledRun[], style: TextStyle, start: number, end: number, key: FlagKey, value: boolean): SetFlagResult;
|
|
6615
|
+
|
|
6512
6616
|
/**
|
|
6513
6617
|
* Build a `TextDrawCommand`. `textCommand` takes a plain string and wraps it
|
|
6514
6618
|
* in one run; `textCommandFromRuns` takes the styled runs directly. Both
|
|
@@ -6587,6 +6691,138 @@ interface TilePatternOpts {
|
|
|
6587
6691
|
*/
|
|
6588
6692
|
declare function createTilePattern(opts: TilePatternOpts): TextureHandle | null;
|
|
6589
6693
|
|
|
6694
|
+
/**
|
|
6695
|
+
* `TilePatternSpec` → `TextureHandle`. The bridge between the serializable
|
|
6696
|
+
* half of a pattern paint and the GL texture that paints it.
|
|
6697
|
+
*
|
|
6698
|
+
* Memoized on the spec's field values, so identical specs across nodes share
|
|
6699
|
+
* one texture and a re-render never re-rasterizes. Entries live for the
|
|
6700
|
+
* session, matching `registerTexture`'s own lifetime.
|
|
6701
|
+
*/
|
|
6702
|
+
|
|
6703
|
+
/**
|
|
6704
|
+
* Build (or fetch) the texture for a spec. Returns `null` when the tile
|
|
6705
|
+
* can't be rasterized — no `OffscreenCanvas`, same as `createTilePattern`.
|
|
6706
|
+
*/
|
|
6707
|
+
declare function resolvePatternSpec(spec: TilePatternSpec): TextureHandle | null;
|
|
6708
|
+
/** Whether a pattern payload is a spec rather than an already-built handle. */
|
|
6709
|
+
declare function isPatternSpec(payload: TextureHandle | TilePatternSpec): payload is TilePatternSpec;
|
|
6710
|
+
/**
|
|
6711
|
+
* Swap a pattern paint's spec payload for the texture that paints it,
|
|
6712
|
+
* leaving every other fill untouched. The built-in painters run this
|
|
6713
|
+
* alongside `fillInPoseFrame`; a consumer emitting its own draw commands
|
|
6714
|
+
* runs it at the same place it runs that one.
|
|
6715
|
+
*
|
|
6716
|
+
* A spec that can't rasterize drops the fill rather than painting garbage.
|
|
6717
|
+
*/
|
|
6718
|
+
declare function resolveFillPattern(fill: FillStyle): FillStyle | null;
|
|
6719
|
+
|
|
6720
|
+
/**
|
|
6721
|
+
* Gradient helpers shared by renderers, editors and exporters: reading a
|
|
6722
|
+
* color out of a stop list, and moving a gradient between its three kinds.
|
|
6723
|
+
*
|
|
6724
|
+
* The stop list is the part every consumer agrees on; the geometry
|
|
6725
|
+
* (`from`/`to`, `center`, `radius`, `angle`) differs per kind, which is what
|
|
6726
|
+
* `withGradientKind` exists to translate.
|
|
6727
|
+
*/
|
|
6728
|
+
|
|
6729
|
+
/**
|
|
6730
|
+
* Color at position `t` (0..1) along a stop list, matching how the GL ramp
|
|
6731
|
+
* texture is built: stops sorted by offset, flat extension past either end,
|
|
6732
|
+
* linear RGB interpolation between neighbors.
|
|
6733
|
+
*
|
|
6734
|
+
* Returns transparent black for an empty list. Alpha is interpolated too, so
|
|
6735
|
+
* a stop list fading to `transparent` samples correctly.
|
|
6736
|
+
*/
|
|
6737
|
+
declare function sampleGradientStops(stops: readonly GradStop[], t: number): string;
|
|
6738
|
+
/**
|
|
6739
|
+
* Retarget a gradient to a different kind, preserving stops, `units` and
|
|
6740
|
+
* `opacity`, and carrying the geometry across as faithfully as the kinds
|
|
6741
|
+
* allow.
|
|
6742
|
+
*
|
|
6743
|
+
* Linear carries a segment; radial and conic carry a center. Converting
|
|
6744
|
+
* between them keeps the center fixed and reads the radius / angle off the
|
|
6745
|
+
* segment, so switching kind in an editor moves the paint as little as
|
|
6746
|
+
* possible instead of snapping to an arbitrary default.
|
|
6747
|
+
*
|
|
6748
|
+
* Lossy in both directions, because the kinds hold different information: a
|
|
6749
|
+
* radial gradient stores no angle, so a round trip through one leaves the
|
|
6750
|
+
* segment horizontal; a conic stores no radius, so a round trip through one
|
|
6751
|
+
* resets the segment's length. An editor that wants a kind switch to be
|
|
6752
|
+
* undoable should keep the original paint rather than converting back.
|
|
6753
|
+
*/
|
|
6754
|
+
declare function withGradientKind(fill: GradientFill, kind: GradientKind): GradientFill;
|
|
6755
|
+
/**
|
|
6756
|
+
* Center / radius / angle for any gradient kind — the shared polar reading
|
|
6757
|
+
* `withGradientKind` converts through, and what on-canvas handles position
|
|
6758
|
+
* themselves from.
|
|
6759
|
+
*
|
|
6760
|
+
* For a linear gradient the center is the segment midpoint, the radius is
|
|
6761
|
+
* half its length, and the angle is its direction.
|
|
6762
|
+
*/
|
|
6763
|
+
declare function gradientGeometry(fill: GradientFill): {
|
|
6764
|
+
center: {
|
|
6765
|
+
x: number;
|
|
6766
|
+
y: number;
|
|
6767
|
+
};
|
|
6768
|
+
radius: number;
|
|
6769
|
+
angle: number;
|
|
6770
|
+
};
|
|
6771
|
+
/**
|
|
6772
|
+
* A gradient spanning a box corner-to-corner (linear) or filling it
|
|
6773
|
+
* (radial / conic) — the sensible starting geometry when a consumer turns a
|
|
6774
|
+
* solid fill into a gradient and has only the shape's bounds to go on.
|
|
6775
|
+
*/
|
|
6776
|
+
declare function gradientForBounds(kind: GradientKind, bounds: {
|
|
6777
|
+
x: number;
|
|
6778
|
+
y: number;
|
|
6779
|
+
width: number;
|
|
6780
|
+
height: number;
|
|
6781
|
+
}, stops: GradStop[], units?: GradientFill['units']): GradientFill;
|
|
6782
|
+
|
|
6783
|
+
/**
|
|
6784
|
+
* Resolve a `units: 'bounds'` gradient into the frame its node is painted in.
|
|
6785
|
+
*
|
|
6786
|
+
* Node painters bake the pose into their geometry (`pathInPoseFrame`) rather
|
|
6787
|
+
* than emitting a per-node transform, so by the time the renderer sees a
|
|
6788
|
+
* scene node there is no node-local space left for a gradient to refer to.
|
|
6789
|
+
* This is the paint-side counterpart: it maps box-relative gradient geometry
|
|
6790
|
+
* onto the same box the path was just projected into, so the two arrive in
|
|
6791
|
+
* the renderer in one frame.
|
|
6792
|
+
*/
|
|
6793
|
+
|
|
6794
|
+
interface FillPoseBox {
|
|
6795
|
+
x: number;
|
|
6796
|
+
y: number;
|
|
6797
|
+
width: number;
|
|
6798
|
+
height: number;
|
|
6799
|
+
}
|
|
6800
|
+
/**
|
|
6801
|
+
* Map a `'bounds'` gradient's `0..1` geometry onto `box`, returning it in the
|
|
6802
|
+
* box's own frame (`units: 'local'`). Any other fill — solid, pattern, or a
|
|
6803
|
+
* gradient in another space — is returned untouched.
|
|
6804
|
+
*
|
|
6805
|
+
* Radii scale by the box's normalized diagonal, SVG's rule for a percentage
|
|
6806
|
+
* radius against `objectBoundingBox`: `sqrt(w² + h²) / sqrt(2)`, which is
|
|
6807
|
+
* exactly `w` for a square box. The renderer's radial gradient is circular,
|
|
6808
|
+
* so a non-square box cannot make it the ellipse SVG would — this keeps the
|
|
6809
|
+
* radius proportionate instead.
|
|
6810
|
+
*/
|
|
6811
|
+
declare function fillInPoseFrame(fill: FillStyle, box: FillPoseBox): FillStyle;
|
|
6812
|
+
/**
|
|
6813
|
+
* Inverse of {@link fillInPoseFrame}: express a gradient already positioned
|
|
6814
|
+
* in `box`'s frame as `0..1` fractions of that box (`units: 'bounds'`), so
|
|
6815
|
+
* it follows the node when moved or resized.
|
|
6816
|
+
*
|
|
6817
|
+
* The importer's counterpart — SVG `userSpaceOnUse` coordinates arrive in
|
|
6818
|
+
* page space, and normalizing them here makes an imported gradient behave
|
|
6819
|
+
* exactly like one drawn in the app.
|
|
6820
|
+
*
|
|
6821
|
+
* A zero-width or zero-height box has no frame to normalize against; the
|
|
6822
|
+
* fill is returned untouched rather than divided by zero.
|
|
6823
|
+
*/
|
|
6824
|
+
declare function fillToBoundsFrame(fill: FillStyle, box: FillPoseBox): FillStyle;
|
|
6825
|
+
|
|
6590
6826
|
/**
|
|
6591
6827
|
* Default `applyOps` implementation: apply each op in order against
|
|
6592
6828
|
* `adapter`. Used by hooks when an adapter omits `applyOps`. Apps that
|
|
@@ -7964,8 +8200,16 @@ declare const RECT_ALIGN_PROJECTION: AlignBoundsProjection<AlignBounds>;
|
|
|
7964
8200
|
* lines. Returns the per-axis snap delta and the matched candidate line(s).
|
|
7965
8201
|
* The two axes resolve independently; on each axis the closest in-tolerance
|
|
7966
8202
|
* (feature, candidate) pair wins.
|
|
8203
|
+
*
|
|
8204
|
+
* `worldTolerance` is per axis because a screen-pixel tolerance is not one
|
|
8205
|
+
* world distance under non-uniform zoom — and each axis here is matched by a
|
|
8206
|
+
* distance along that axis alone, so there is an exact answer rather than an
|
|
8207
|
+
* approximation. Pass the same number twice for a world-space tolerance.
|
|
7967
8208
|
*/
|
|
7968
|
-
declare function matchAlignment(bounds: AlignBounds, candidates: readonly Guide[], worldTolerance:
|
|
8209
|
+
declare function matchAlignment(bounds: AlignBounds, candidates: readonly Guide[], worldTolerance: {
|
|
8210
|
+
x: number;
|
|
8211
|
+
y: number;
|
|
8212
|
+
}, anchors: {
|
|
7969
8213
|
x: readonly AlignAnchor[];
|
|
7970
8214
|
y: readonly AlignAnchor[];
|
|
7971
8215
|
}): AlignMatchResult;
|
|
@@ -8987,6 +9231,43 @@ declare function ExcludeIcon(): react_jsx_runtime.JSX.Element;
|
|
|
8987
9231
|
declare function DivideIcon(): react_jsx_runtime.JSX.Element;
|
|
8988
9232
|
declare function CropIcon(): react_jsx_runtime.JSX.Element;
|
|
8989
9233
|
|
|
9234
|
+
/** What the registry knows at dispatch time. */
|
|
9235
|
+
interface EligibilityState {
|
|
9236
|
+
focusedId: string | null;
|
|
9237
|
+
heldTriggers: ReadonlySet<string>;
|
|
9238
|
+
/** Ids the host reports as hotkey-engaged. A declared `offhand` registers
|
|
9239
|
+
* the binding, but `tool.offhand`'s invoker still reports engagement by
|
|
9240
|
+
* pushing an id — this retires only if that contract changes. */
|
|
9241
|
+
engagedIds?: ReadonlySet<string>;
|
|
9242
|
+
/** Whether the active mode allows these capability tags. Omitted → allow. */
|
|
9243
|
+
allows?: (tags: readonly CapabilityTag[]) => boolean;
|
|
9244
|
+
}
|
|
9245
|
+
/**
|
|
9246
|
+
* The scope tier an entry's bindings are live at, or null when none are.
|
|
9247
|
+
* Ordered hotkey > active > ambient to match the dispatcher's own walk.
|
|
9248
|
+
*/
|
|
9249
|
+
declare function liveScope(id: string, eligibility: Eligibility, state: EligibilityState): BindingScope | null;
|
|
9250
|
+
|
|
9251
|
+
/**
|
|
9252
|
+
* Every binding the entry set contributes right now, each tiered by the
|
|
9253
|
+
* entry's own declared eligibility. Entries with no live tier are omitted.
|
|
9254
|
+
*
|
|
9255
|
+
* Order is preserved: `matchSorted` sorts by specificity within a scope and
|
|
9256
|
+
* breaks ties by declaration order, so the caller's entry order decides which
|
|
9257
|
+
* of two same-specificity bindings in one tier wins.
|
|
9258
|
+
*/
|
|
9259
|
+
declare function scopeBindings(entries: Iterable<Contribution>, state: EligibilityState): ScopedBinding[];
|
|
9260
|
+
|
|
9261
|
+
/**
|
|
9262
|
+
* Concatenate contribution bundles into one registry, preserving order —
|
|
9263
|
+
* entry order decides which of two same-specificity bindings in one scope
|
|
9264
|
+
* tier wins, so it is part of the result, not an accident of it.
|
|
9265
|
+
*
|
|
9266
|
+
* Throws on a duplicate id rather than dropping one: a feature silently
|
|
9267
|
+
* losing its bindings is the failure this registry exists to make loud.
|
|
9268
|
+
*/
|
|
9269
|
+
declare function mergeContributions(...bundles: readonly Contribution[][]): Contribution[];
|
|
9270
|
+
|
|
8990
9271
|
interface InsertOverlayStyle {
|
|
8991
9272
|
fill?: string;
|
|
8992
9273
|
stroke?: string;
|
|
@@ -8994,4 +9275,4 @@ interface InsertOverlayStyle {
|
|
|
8994
9275
|
lineWidth?: number;
|
|
8995
9276
|
}
|
|
8996
9277
|
|
|
8997
|
-
export { ANCHOR_HIT_BASE_PX, Action, ActionsProp, ActionsProviderIfRoot, ActionsRegistry, Affordance, AffordanceBinding, AffordanceHit, AffordanceRegion, type AffordanceRegionHit, type AlignAdapter, type AlignAnchor, type AlignBounds, type AlignBoundsProjection, type AlignEdge, type AlignMatchResult, type AlignMoveArgs, type AlignmentBehaviorBase, type AnchorHit, type AnchorScratch, type AnchorState, type AnimateOnSetPoseOptions, type AnimateToBoundsOptions, type AnimationHandle, type Animator, AnyTool, AreaSelectAdapter, type ArrayAdapter, type ArrayAdapterConfig, BUNDLE_TOOLS, BooleansAdapter, Bounds, BoundsConstraint, type BuildChromeCtxArgs, type BuiltinShapeToolId, type BuiltinToolId, type BuiltinToolOptions, COARSE_TARGET_SCALE, CURVE_REPS, type CanvasExtensionApi, type CanvasFocusReturn, type CanvasHelpers, type CanvasProps, type CanvasSelectionMode, type CanvasSize, type CanvasSizeSnapshot, type CellHighlightLayerOpts, ChromeCtx, ChromeId, ChromeState, type ClampBounds, ClipboardSnapshot, type CoalescedCtx, type ColorInterpolate, type ColorOverride, type ColorOverrideFn, ColorOverrideRegistry, type ColorSpace, CommonAffordanceScratch, type ComposeSelectionPoseOpts, type ComputeFitViewOptions, Condition, ContentHandlerEntry, type CornerResizeAffordanceOptions, type CornerResizeScratch, type CreateChildrenLayerOpts, type CreateParallaxLayerOpts, type CreatePathEditingOverlayLayerOptions, type CreatePathLayerOpts, type CreatePenPreviewLayerOptions, type CreateTextLayerOpts, type CreateViewportLayerOpts, CropIcon, CursorCoordsHud, type CursorCoordsHudProps, type CurveRepKind, type CurveRepresentation, type CustomLayerEntry, type CycleHandle, type CycleVertexColorsOptions, DEFAULT_ALPHA_DECAY, DEFAULT_ALPHA_MIN, DEFAULT_DEBUG_THEME, DEFAULT_DEVICE_PROFILE, DEFAULT_FILL_COLOR, DEFAULT_FLATTEN_TOLERANCE, DEFAULT_GUIDE_TOLERANCE_PX, DEFAULT_HANDLE_SIZE, DEFAULT_PALETTE, DEFAULT_ROTATION_HANDLE_DISTANCE, DEFAULT_STROKE_COLOR, DEFAULT_VELOCITY_DECAY, DebugConfig, DebugSink, DebugSnapshot, DebugTheme, type DecayLoopConfig, type DecayOptions, type DefaultTextData, DepRegistryProviderIfRoot, DepSchema, type DeriveAlignmentGuidesOptions, DetectedDeviceFacts, DeviceProfile, DeviceProfileProvider, type DeviceProfileProviderProps, Dims, type Discriminator, Dispatcher, type DistributeAdapter, type DistributeAxis, type DistributeMode, DivideIcon, type DragGestureController, type DragGestureCtx, type DragGestureEndCtx, type DragGesturePhase, type DragGesturePoint, type DragHandleOptions, type DragPayload, type DragRadialController, type DragRadialCtx, type DragRadialEndCtx, type DragRadialPoint, type DragRadialState, type DragRectBounds, type DragRectController, type DragRectCtx, type DragRectEndCtx, type DragRectPoint, DrawCommand, type DropZoneOptions, EASINGS, type EasingFn, type EasingName, EllipseIcon, ExcludeIcon, EyedropperIcon, FALLBACK_FIT_VIEW, FillStyle, type FitTextPoseOptions, FitViewToBoundsOptions, type FreeformOptions, GHOST_STROKE, type GateLayerOptions, GeometryProjection, type GestureSource, type GridLayerOpts, type GridSlotConfig, Guide, type GuideSnapOptions, type GuidesLayerOpts, HANDLE_BASE_PX, HandIcon, type InertiaConfig as HandToolInertiaConfig, type HandleDragPoint, type HeadlessCanvasLike, HotkeyTrigger, type IconProps, type ImageNodeData, type ImageStatus, type IndicatorStyle, InsertAdapter, InsertBehavior, InsertExtras, type InsertNodeFactory, type InsertOp, type InsertOverlayStyle, type Interpolate, type InterpolatorFactory, IntersectIcon, KIT_SHAPE_KINDS, type LabelOptions, LassoHitMode, LassoIcon, LassoSelectAdapter, LassoSelectBehavior, LayerEnumerableAdapter, type LayerSlotValue, type LayersMap, type LayoutLine, type LayoutResult, LayoutSnap, LayoutStrategy, type LifecycleAnimation, LineIcon, type LinePoint, type LoopFactory, type LoopOptions, MIXED, MOVE_ANCHORS, type MarkdownFontOptions, type MeasureFn, type MeasureTextBoundsOpts, type MeasuredText, MinimapCanvas, type MinimapCanvasProps, type MinimapFit, type Mixed, ModifierState, type MomentumOptions, MoveAdapter, MoveBehavior, type NestedHitOpts, type NestedHitTester, type NodeClientRect, NodeId, type NodeInk, type NodePaintCtx, type NodeProperties, type NodePropertiesEntry, type NodeRouting, type NodeRoutingEntry, type NodeShapeEntry, type OpenFilePickerOptions, OrderedAdapter, OriginProjection, PATH_ANCHOR_CHROME_ID, type PanBounds, type ParallaxOpts, Path, type PathAnchor, type PathAnchorAffordanceOptions, PathBuilder, PathDrawCommand, type PathEditingOverlayStyle, PathFillRule, type PathInWorldPose, type PenAnchor, PenIcon, type PenPreviewStyle, type PenScratch, type PenSubpath, PencilIcon, type PencilPoint, type PhysicsHandle, type PhysicsOptions, PickHud, type PickHudProps, type PickTopMostHitAdapter, type PinchZoomToolOpts, type PixelRenderPlan, type PointInPathOptions, type PointInTextPoseOpts, PointSnapBehavior, PointerProviderIfRoot, type PointerSample, type PointerStylusState, PolygonIcon, PolygonPath, type PolygonPoint, PoseProjection, type PoseRotation, type PositionedRun, type PressureToWidthOptions, type Pt, RECT_ALIGN_PROJECTION, ROTATION_HANDLE_BASE_PX, type RangeStyle, type RasterImage, type Rect, RectIcon, RectPath, RectPose, type RegisterNodeShapeOptions, RegisteredOp, RenderLayer, type RenderSceneToCanvasArgs, type RenderSceneToPixelsArgs, type ReorderDirection, ResizeAdapter, ResizeAnchor, ResizePose, ResolvedTextStyle, RotateAdapter, RotateBehavior, type RotateGeometry, RotatedPose, type RotationAffordanceOptions, type RotationHandle, type RotationScratch, Rule, RuleCtx, type RunStylePatch, SPRING_PRESETS, type ScalarOrXY, Scene, SceneAdapter, type SceneAdapterSelection, SceneCanvas, type SceneCanvasAdapter, type SceneCanvasApi, type SceneCanvasHit, type SceneCanvasProps, Node$1 as SceneNode, type SceneNodeClientRectOpts, SceneRegistry, type SceneSlotConfig, type SceneToAdapterOptions, SceneViewCanvas, type SceneViewCanvasProps, type SceneViewDrawOne, type ScratchKey, type ScratchStore, type SelectAdapter, type SelectFromLassoOptions, SelectIcon, SelectionApi, SelectionContextProvider, SelectionContextProviderIfRoot, type SelectionContextValue, type SelectionHandlesLayerOpts, type SelectionOutlineLayerOpts, type SelectionOverlayLayerOpts, type SelectionOverlaySlotConfig, SerializedScene, type SetPathFields, ShaderProgramHandle, type ShapeCoversPointOptions, type SharedAnchor, type Simulation, type SimulationForce, type SimulationNode, SliceDep, type SnapPattern, type SnapPointOptions, SnapStrategy, type SplitByLineOptions, type SpringOptions, type SpringPoseOptions, type SpringPreset, type SpringPresetName, type SpringVertexColorsOptions, type StaggerBuilder, type StaggerDelay, type StaggerFactory, type StaggerOptions, type StaggerPerItem, type StaggerSpringPoseOptions, type StaggerTweenOptions, type StaggerVertexColorsOptions, type StandardSlotConfig, type StandardSlotName, StarIcon, type StarPoint, type StartEditOptions, Stroke, type StyleKey, StyledRun, type StylusData, SubtractIcon, SvgIngestOptions, type TextEditScreenPose, type TextEditSelection, TextIcon, type TextLineBoxesOpts, type TextPose, type TextRenderer, TextStyle, TextVerticalAlign, TextureHandle, type ThresholdDragHandle, type ThresholdDragOptions, type TileGridOptions, type TilePatternOpts, Tool, type ToolBundle, ToolCtx, ToolKeybinding, type ToolPref, type ToolPrefBoolean, type ToolPrefBooleanControl, type ToolPrefColor, type ToolPrefCustom, type ToolPrefEnum, type ToolPrefEnumControl, type ToolPrefGroup, type ToolPrefKind, type ToolPrefLeaf, type ToolPrefNumber, type ToolPrefNumberControl, type ToolPrefNumberUnit, type ToolPrefPaint, type ToolPrefString, type ToolPrefStringControl, type ToolsApi, type TweenLoopOptions, type TweenOptions, type TweenPoseOptions, type TweenVertexColorsOptions, UnionIcon, UnitSystem, UnitValue, UnknownIcon, type UseAlignOptions, type UseAlignReturn, type UseAnimatorOptions, type UseArrayAdapterOptions, type UseBooleansOptions, type UseBooleansReturn, type UseCanvasFocusOptions, type UseDistributeOptions, type UseDistributeReturn, type UseDragGestureOptions, type UseDragRadialOptions, type UseDragRectOptions, type UseEyedropperToolOptions, type UseGestureDispatcherOptions, type UseGridCellHoverOptions, type UseGridCellHoverReturn, type UseGuidesReturn, type UseHandToolOptions, type UseHandleDragOptions, type UseHandleDragReturn, type UseHoverTrackingArgs, type UseImageToolOptions, type UseKeybindingsOptions, type UseLassoSelectOptions, type UseLassoToolOptions, UseMoveOptions, type UsePenToolOptions, type UsePointerStylusOptions, type UsePolygonToolOptions, UseResizeOptions, type UseResizePolicyOptions, type UseRotateOptions, type UseRotateToolOptions, UseSceneOptions, type UseSceneTextEditOptions, type UseSceneTextEditReturn, type UseSceneTrivialOptions, type UseSelectToolOptions, UseSelectionOptions, type UseSimulationOptions, type UseStandardActionsOptions, type UseStarToolOptions, type UseTextEditOptions, type UseTextEditReturn, type UseToolsOptions, type UseZoomOptions, type UseZoomReturn, VERSION, type Vec2, type VertexColorChannel, View, ViewTransform, type ViewportConfig, ViewportDims, type ViewportZoomOptions, VisibilityRules, WeaselProvider, type WheelInput, type WheelState, ZoomBound, type ZoomBounds, type ZoomClampOpts, ZoomFactor, aabbCenter, actionIs, alignDeltaFor, alignInsertBehavior, alignMoveBehavior, alignResizeBehavior, always, and, animateLifecycle, animateOnSetPose, annulusSemiAxes, applyHitExistingGate, applyOpsTo, applyStyleToRange, areaSelectAction, arrayAdapter, bezierCubic, bezierQuadratic, boundsOfPath, buildChromeCtx, buildSceneViewCommands, canBringForward, canHover, canSendBackward, capabilityAll, capabilityIn, capabilityIs, capabilityNot, caretIndexAt, cellAt, charOffsetToDomPosition, clampView, clearSelectionAction, clientToCanvas, cloneAction, coarsePointer, composeAffordanceLayer, composePath, composeSelectionPose, computeFitView, computeIndicatorCommand, computeWheelAction, cond, constrainTo45, containedThenNearest, countPathAnchors, createCellHighlightLayer, createChildrenLayer, createCornerResizeAffordance, createDebugOverlayLayer, createDebugSink, createDeleteOp, createGridLayer, createGuidesLayer, createHistory, createInsertOp, createMarkdownRenderer, createMoveToIndexOp, createNodeProperties, createNodeRouting, createParallaxLayer, createPathAnchorAffordances, createPathEditingOverlayLayer, createPathLayer, createPenPreviewLayer, createReorderOp, createReparentOp, createRotationAffordance, createScene, createSelectionHandlesLayer, createSelectionOutlineLayer, createSelectionOverlayLayer, createSetDataOp, createSetLayerOp, createSetPathOp, createSetSelectionOp, createSetTextOp, createTextLayer, createTilePattern, createTransformOp, createViewportLayer, cycleVertexColors, decomposePath, defaultCommitAdapter, defaultDrawOne, defaultLabelTextRenderer, defaultNodeProperties, defaultNodeRouting, defaultVisibilityRules, deleteScratch, deriveAlignmentGuides, deriveParallaxView, dispatchApplyBatch, dlog, domPositionToCharOffset, domToRuns, dwarn, easeIn, easeInBack, easeInBounce, easeInCirc, easeInCubic, easeInElastic, easeInExpo, easeInOut, easeInOutBack, easeInOutBounce, easeInOutCirc, easeInOutCubic, easeInOutElastic, easeInOutExpo, easeInOutQuad, easeInOutQuart, easeInOutQuint, easeInOutSine, easeInQuad, easeInQuart, easeInQuint, easeInSine, easeOut, easeOutBack, easeOutBounce, easeOutCirc, easeOutCubic, easeOutElastic, easeOutExpo, easeOutQuad, easeOutQuart, easeOutQuint, easeOutSine, editAnchorsAction, ellipsePath, enumerateAnchors, findNodeShape, findShapeInk, findShapeSilhouette, fitTextPose, fitToBounds, fitZoom, flattenCubic, flattenCubicWithArcLen, flattenQuadratic, flattenQuadraticWithArcLen, focused, forEachCoalesced, freeform, gateLayer, gesturing, getAlpha01, getImageBitmap, getNodeShapes, getScratch, getStylusData, guideSnapStrategy, hexToRgba, hitAffordanceRegions, hitAnchor, hitRotationHandle, hovering, hoveringSelected, imageStatus, inferredNodeProperties, inferredNodeRouting, insertAction, isDebugEnabled, isEditableTarget, lassoSelectAction, layoutMarkdown, lerpColorArray, lerpOklab, lerpOklch, linePath, linear, makeViewportZoomAction, matchAlignment, matchesKeyBinding, meanScale, measureText, measureTextBounds, measuredWidth, mergeAlphaFromPrev, modeIn, modeIs, modeNot, modifierHeld, momentum, moveAction, multiActive, nearest, nearestWithin, nestedHitTester, never, none, normalizeHex, not, nurbs, oklabToOklch, oklabToSrgbU8, oklchToOklab, openFilePicker, or, parseColor, parseColorToRgba255, parseDebugFlags, pathContainsPoint, pathContainsPolygon, pathContainsRect, pathDistanceToPoint, pathDivide, pathExclude, pathFromD, pathInPoseFrame, pathInWorld, pathIntersect, pathIntersectsPolygon, pathIntersectsRect, pathOriginProjection, pathPoseDescriptor, pathSubtract, pathToAnchors, pathUnion, pickTopMostHit, pinchZoomAction, planPixelRender, pointInPath, pointInRotatedRect, pointInTextPose, polygonFromPoints, poseRotationOf, pressureToWidth, rainbowVertexColors, rebuildOp, rectCorners, rectPath, registerNodeShape, registerOpFactory, regularPolygonPath, renderLabel, renderSceneToCanvas, renderSceneToPixels, resizeAction, resolveColor, resolveDeviceProfile, resolveVisibility, rgbaToHex, rotateAction, rotateAroundAABBCenter, rotatePathAround, rotatePoint, rotatedRectCorners, rotationDegreesUnit, rotationHandle, roundToCell, runsToDom, scalePathToBounds, sceneFromJSON, sceneNodeClientRect, sceneToAdapter, scratchKey, selectFromLasso, selectionAtLeast, selectionEmpty, selectionIs, setScratch, shapeCoversPoint, snap, snapPoint, solidVertexColors, spiro, splitPathByLine, splitSubpaths, springPose, springVertexColors, srgbU8ToOklab, staggerVertexColors, starPath, startThresholdDrag, styleAtRange, subscribeImageReady, textCommand, textLineBoxes, tileGrid, toHex8, transformPath, translatePath, translatePolygonInPlace, translatePoseViaDescriptor, tweenPose, tweenVertexColors, unionBounds, unionBoundsPath, useAlign, useAnimator, useArrayAdapter, useAutoCenter, useBooleans, useBooleansAdapter, useCanvasFocus, useCanvasSize, useDecayLoop, useDeviceProfile, useDistribute, useDragGesture, useDragHandle, useDragRadial, useDragRect, useDropZone, useEllipseTool, useEyedropperTool, useGestureDispatcher, useGridCellHover, useGuides, useHandTool, useHandleDrag, useHoverTracking, useImageTool, useKeybindings, useLassoTool, useLineTool, usePenTool, usePencilTool, usePinchGesture, usePinchZoomTool, usePointerStylus, usePolygonTool, usePublishSelection, useRectTool, useResizePolicy, useRotateTool, useScene, useSceneAdapter, useSceneTextEdit, useSelectTool, useSelectionContext, useSimulation, useSliceDep, useStandardActions, useStarTool, useTextEdit, useTextTool, useTools, useVelocityTracker, useViewAnimation, useViewTween, useZoom, viewportDragPanAction, viewportZoomAction, when, withAlpha01, withCoord, worldEditToStorage, zoomAt, zoomAtLeast };
|
|
9278
|
+
export { ANCHOR_HIT_BASE_PX, Action, ActionsProp, ActionsProviderIfRoot, ActionsRegistry, Affordance, AffordanceBinding, AffordanceHit, AffordanceRegion, type AffordanceRegionHit, type AlignAdapter, type AlignAnchor, type AlignBounds, type AlignBoundsProjection, type AlignEdge, type AlignMatchResult, type AlignMoveArgs, type AlignmentBehaviorBase, type AnchorHit, type AnchorScratch, type AnchorState, type AnimateOnSetPoseOptions, type AnimateToBoundsOptions, type AnimationHandle, type Animator, AnyTool, AreaSelectAdapter, type ArrayAdapter, type ArrayAdapterConfig, BUNDLE_TOOLS, BindingScope, BooleansAdapter, Bounds, BoundsConstraint, type BuildChromeCtxArgs, type BuiltinShapeToolId, type BuiltinToolId, type BuiltinToolOptions, COARSE_TARGET_SCALE, CURVE_REPS, type CanvasExtensionApi, type CanvasFocusReturn, type CanvasHelpers, type CanvasProps, type CanvasSelectionMode, type CanvasSize, type CanvasSizeSnapshot, type CellHighlightLayerOpts, ChromeCtx, ChromeId, ChromeState, type ClampBounds, ClipboardSnapshot, type CoalescedCtx, type ColorInterpolate, type ColorOverride, type ColorOverrideFn, ColorOverrideRegistry, type ColorSpace, CommonAffordanceScratch, type ComposeSelectionPoseOpts, type ComputeFitViewOptions, Condition, ContentHandlerEntry, Contribution, type CornerResizeAffordanceOptions, type CornerResizeScratch, type CreateChildrenLayerOpts, type CreateParallaxLayerOpts, type CreatePathEditingOverlayLayerOptions, type CreatePathLayerOpts, type CreatePenPreviewLayerOptions, type CreateTextLayerOpts, type CreateViewportLayerOpts, CropIcon, CursorCoordsHud, type CursorCoordsHudProps, type CurveRepKind, type CurveRepresentation, type CustomLayerEntry, type CycleHandle, type CycleVertexColorsOptions, DEFAULT_ALPHA_DECAY, DEFAULT_ALPHA_MIN, DEFAULT_DEBUG_THEME, DEFAULT_DEVICE_PROFILE, DEFAULT_FILL_COLOR, DEFAULT_FLATTEN_TOLERANCE, DEFAULT_GUIDE_TOLERANCE_PX, DEFAULT_HANDLE_SIZE, DEFAULT_PALETTE, DEFAULT_ROTATION_HANDLE_DISTANCE, DEFAULT_STROKE_COLOR, DEFAULT_VELOCITY_DECAY, DebugConfig, DebugSink, DebugSnapshot, DebugTheme, type DecayLoopConfig, type DecayOptions, type DefaultTextData, DepRegistryProviderIfRoot, DepSchema, type DeriveAlignmentGuidesOptions, DetectedDeviceFacts, DeviceProfile, DeviceProfileProvider, type DeviceProfileProviderProps, Dims, type Discriminator, Dispatcher, type DistributeAdapter, type DistributeAxis, type DistributeMode, DivideIcon, type DragGestureController, type DragGestureCtx, type DragGestureEndCtx, type DragGesturePhase, type DragGesturePoint, type DragHandleOptions, type DragPayload, type DragRadialController, type DragRadialCtx, type DragRadialEndCtx, type DragRadialPoint, type DragRadialState, type DragRectBounds, type DragRectController, type DragRectCtx, type DragRectEndCtx, type DragRectPoint, DrawCommand, type DropZoneOptions, EASINGS, type EasingFn, type EasingName, Eligibility, type EligibilityState, EllipseIcon, ExcludeIcon, EyedropperIcon, FALLBACK_FIT_VIEW, type FillPoseBox, FillStyle, type FitTextPoseOptions, FitViewToBoundsOptions, type FlagKey, type FreeformOptions, GHOST_STROKE, type GateLayerOptions, GeometryProjection, type GestureSource, GradStop, GradientFill, GradientKind, type GridLayerOpts, type GridSlotConfig, Guide, type GuideSnapOptions, type GuidesLayerOpts, HANDLE_BASE_PX, HandIcon, type InertiaConfig as HandToolInertiaConfig, type HandleDragPoint, type HeadlessCanvasLike, HotkeyTrigger, type IconProps, type ImageNodeData, type ImageStatus, type IndicatorStyle, InsertAdapter, InsertBehavior, InsertExtras, type InsertNodeFactory, type InsertOp, type InsertOverlayStyle, type Interpolate, type InterpolatorFactory, IntersectIcon, KIT_SHAPE_KINDS, type LabelOptions, LassoHitMode, LassoIcon, LassoSelectAdapter, LassoSelectBehavior, LayerEnumerableAdapter, LayerHit, type LayerSlotValue, type LayersMap, type LayoutLine, type LayoutResult, LayoutSnap, LayoutStrategy, type LifecycleAnimation, LineIcon, type LinePoint, type LoopFactory, type LoopOptions, MIXED, MOVE_ANCHORS, type MarkdownFontOptions, type MeasureFn, type MeasureTextBoundsOpts, type MeasuredText, MinimapCanvas, type MinimapCanvasProps, type MinimapFit, type Mixed, ModifierState, type MomentumOptions, MoveAdapter, MoveBehavior, type NestedHitOpts, type NestedHitTester, type NodeClientRect, NodeId, type NodeInk, type NodePaintCtx, type NodeProperties, type NodePropertiesEntry, type NodeRouting, type NodeRoutingEntry, type NodeShapeEntry, type OpenFilePickerOptions, OrderedAdapter, OriginProjection, PATH_ANCHOR_CHROME_ID, type PanBounds, type ParallaxOpts, Path, type PathAnchor, type PathAnchorAffordanceOptions, PathBuilder, PathDrawCommand, type PathEditingOverlayStyle, PathFillRule, type PathInWorldPose, type PenAnchor, PenIcon, type PenPreviewStyle, type PenScratch, type PenSubpath, PencilIcon, type PencilPoint, type PhysicsHandle, type PhysicsOptions, PickHud, type PickHudProps, type PickTopMostHitAdapter, type PinchZoomToolOpts, type PixelRenderPlan, type PointInPathOptions, type PointInTextPoseOpts, PointSnapBehavior, PointerProviderIfRoot, type PointerSample, type PointerStylusState, PolygonIcon, PolygonPath, type PolygonPoint, PoseProjection, type PoseRotation, type PositionedRun, type PressureToWidthOptions, type Pt, RECT_ALIGN_PROJECTION, ROTATION_HANDLE_BASE_PX, type RangeStyle, type RasterImage, type Rect, RectIcon, RectPath, RectPose, type RegisterNodeShapeOptions, RegisteredOp, RenderLayer, type RenderSceneToCanvasArgs, type RenderSceneToPixelsArgs, type ReorderDirection, ResizeAdapter, ResizeAnchor, ResizePose, ResolvedTextStyle, RotateAdapter, RotateBehavior, type RotateGeometry, RotatedPose, type RotationAffordanceOptions, type RotationHandle, type RotationScratch, Rule, RuleCtx, type RunStylePatch, SPRING_PRESETS, type ScalarOrXY, Scene, SceneAdapter, type SceneAdapterSelection, SceneCanvas, type SceneCanvasAdapter, type SceneCanvasApi, type SceneCanvasHit, type SceneCanvasProps, Node$1 as SceneNode, type SceneNodeClientRectOpts, SceneRegistry, type SceneSlotConfig, type SceneToAdapterOptions, SceneViewCanvas, type SceneViewCanvasProps, type SceneViewDrawOne, ScopedBinding, type ScratchKey, type ScratchStore, type SelectAdapter, type SelectFromLassoOptions, SelectIcon, SelectionApi, SelectionContextProvider, SelectionContextProviderIfRoot, type SelectionContextValue, type SelectionHandlesLayerOpts, type SelectionOutlineLayerOpts, type SelectionOverlayLayerOpts, type SelectionOverlaySlotConfig, SerializedScene, type SetFlagResult, type SetPathFields, ShaderProgramHandle, type ShapeCoversPointOptions, type SharedAnchor, type Simulation, type SimulationForce, type SimulationNode, SliceDep, type SnapPattern, type SnapPointOptions, SnapStrategy, type SplitByLineOptions, type SpringOptions, type SpringPoseOptions, type SpringPreset, type SpringPresetName, type SpringVertexColorsOptions, type StaggerBuilder, type StaggerDelay, type StaggerFactory, type StaggerOptions, type StaggerPerItem, type StaggerSpringPoseOptions, type StaggerTweenOptions, type StaggerVertexColorsOptions, type StandardSlotConfig, type StandardSlotName, StarIcon, type StarPoint, type StartEditOptions, Stroke, type StyleKey, StyledRun, type StylusData, SubtractIcon, SvgIngestOptions, type TextEditScreenPose, type TextEditSelection, TextIcon, type TextLineBoxesOpts, type TextPose, type TextRenderer, TextStyle, TextVerticalAlign, TextureHandle, type ThresholdDragHandle, type ThresholdDragOptions, type TileGridOptions, type TilePatternOpts, TilePatternSpec, Tool, type ToolBundle, ToolCtx, ToolKeybinding, type ToolPref, type ToolPrefBoolean, type ToolPrefBooleanControl, type ToolPrefColor, type ToolPrefCustom, type ToolPrefEnum, type ToolPrefEnumControl, type ToolPrefGroup, type ToolPrefKind, type ToolPrefLeaf, type ToolPrefNumber, type ToolPrefNumberControl, type ToolPrefNumberUnit, type ToolPrefPaint, type ToolPrefString, type ToolPrefStringControl, type ToolsApi, type TweenLoopOptions, type TweenOptions, type TweenPoseOptions, type TweenVertexColorsOptions, UnionIcon, UnitSystem, UnitValue, UnknownIcon, type UseAlignOptions, type UseAlignReturn, type UseAnimatorOptions, type UseArrayAdapterOptions, type UseBooleansOptions, type UseBooleansReturn, type UseCanvasFocusOptions, type UseDistributeOptions, type UseDistributeReturn, type UseDragGestureOptions, type UseDragRadialOptions, type UseDragRectOptions, type UseEyedropperToolOptions, type UseGestureDispatcherOptions, type UseGridCellHoverOptions, type UseGridCellHoverReturn, type UseGuidesReturn, type UseHandToolOptions, type UseHandleDragOptions, type UseHandleDragReturn, type UseHoverTrackingArgs, type UseImageToolOptions, type UseKeybindingsOptions, type UseLassoSelectOptions, type UseLassoToolOptions, UseMoveOptions, type UsePenToolOptions, type UsePointerStylusOptions, type UsePolygonToolOptions, UseResizeOptions, type UseResizePolicyOptions, type UseRotateOptions, type UseRotateToolOptions, UseSceneOptions, type UseSceneTextEditOptions, type UseSceneTextEditReturn, type UseSceneTrivialOptions, type UseSelectToolOptions, UseSelectionOptions, type UseSimulationOptions, type UseStandardActionsOptions, type UseStarToolOptions, type UseTextEditOptions, type UseTextEditReturn, type UseToolsOptions, type UseZoomOptions, type UseZoomReturn, VERSION, type Vec2, type VertexColorChannel, View, ViewTransform, type ViewportConfig, ViewportDims, type ViewportZoomOptions, VisibilityRules, WeaselProvider, type WheelInput, type WheelState, ZoomBound, type ZoomBounds, type ZoomClampOpts, ZoomFactor, aabbCenter, actionIs, alignDeltaFor, alignInsertBehavior, alignMoveBehavior, alignResizeBehavior, always, and, animateLifecycle, animateOnSetPose, annulusSemiAxes, applyHitExistingGate, applyOpsTo, applyStyleToRange, areaSelectAction, arrayAdapter, bezierCubic, bezierQuadratic, boundsOfPath, buildChromeCtx, buildSceneViewCommands, canBringForward, canHover, canSendBackward, capabilityAll, capabilityIn, capabilityIs, capabilityNot, caretIndexAt, cellAt, charOffsetToDomPosition, clampView, clearSelectionAction, clientToCanvas, cloneAction, coarsePointer, composeAffordanceLayer, composePath, composeSelectionPose, computeFitView, computeIndicatorCommand, computeWheelAction, cond, constrainTo45, containedThenNearest, countPathAnchors, createCellHighlightLayer, createChildrenLayer, createCornerResizeAffordance, createDebugOverlayLayer, createDebugSink, createDeleteOp, createGridLayer, createGuidesLayer, createHistory, createInsertOp, createMarkdownRenderer, createMoveToIndexOp, createNodeProperties, createNodeRouting, createParallaxLayer, createPathAnchorAffordances, createPathEditingOverlayLayer, createPathLayer, createPenPreviewLayer, createReorderOp, createReparentOp, createRotationAffordance, createScene, createSelectionHandlesLayer, createSelectionOutlineLayer, createSelectionOverlayLayer, createSetDataOp, createSetLayerOp, createSetPathOp, createSetSelectionOp, createSetTextOp, createTextLayer, createTilePattern, createTransformOp, createViewportLayer, cycleVertexColors, decomposePath, defaultCommitAdapter, defaultDrawOne, defaultLabelTextRenderer, defaultNodeProperties, defaultNodeRouting, defaultVisibilityRules, deleteScratch, deriveAlignmentGuides, deriveParallaxView, dispatchApplyBatch, dlog, domPositionToCharOffset, domToRuns, dwarn, easeIn, easeInBack, easeInBounce, easeInCirc, easeInCubic, easeInElastic, easeInExpo, easeInOut, easeInOutBack, easeInOutBounce, easeInOutCirc, easeInOutCubic, easeInOutElastic, easeInOutExpo, easeInOutQuad, easeInOutQuart, easeInOutQuint, easeInOutSine, easeInQuad, easeInQuart, easeInQuint, easeInSine, easeOut, easeOutBack, easeOutBounce, easeOutCirc, easeOutCubic, easeOutElastic, easeOutExpo, easeOutQuad, easeOutQuart, easeOutQuint, easeOutSine, editAnchorsAction, ellipsePath, enumerateAnchors, fillInPoseFrame, fillToBoundsFrame, findNodeShape, findShapeInk, findShapeSilhouette, fitTextPose, fitToBounds, fitZoom, flattenCubic, flattenCubicWithArcLen, flattenQuadratic, flattenQuadraticWithArcLen, focused, forEachCoalesced, freeform, gateLayer, gesturing, getAlpha01, getImageBitmap, getNodeShapes, getScratch, getStylusData, gradientForBounds, gradientGeometry, guideSnapStrategy, hexToRgba, hitAffordanceRegions, hitAnchor, hitRotationHandle, hovering, hoveringSelected, imageStatus, inferredNodeProperties, inferredNodeRouting, insertAction, isDebugEnabled, isEditableTarget, isPatternSpec, lassoSelectAction, layoutMarkdown, lerpColorArray, lerpOklab, lerpOklch, linePath, linear, liveScope, makeViewportZoomAction, matchAlignment, matchesKeyBinding, meanScale, measureText, measureTextBounds, measuredWidth, mergeAlphaFromPrev, mergeContributions, modeIn, modeIs, modeNot, modifierHeld, momentum, moveAction, multiActive, nearest, nearestWithin, nestedHitTester, never, nodeHasFlag, none, normalizeHex, not, nurbs, oklabToOklch, oklabToSrgbU8, oklchToOklab, openFilePicker, or, parseColor, parseColorToRgba255, parseDebugFlags, pathContainsPoint, pathContainsPolygon, pathContainsRect, pathDistanceToPoint, pathDivide, pathExclude, pathFromD, pathInPoseFrame, pathInWorld, pathIntersect, pathIntersectsPolygon, pathIntersectsRect, pathOriginProjection, pathPoseDescriptor, pathSubtract, pathToAnchors, pathUnion, pickTopMostHit, pinchZoomAction, planPixelRender, pointInPath, pointInRotatedRect, pointInTextPose, polygonFromPoints, poseRotationOf, pressureToWidth, pxExtent, rainbowVertexColors, rebuildOp, rectCorners, rectPath, registerNodeShape, registerOpFactory, regularPolygonPath, renderLabel, renderSceneToCanvas, renderSceneToPixels, resizeAction, resolveColor, resolveDeviceProfile, resolveFillPattern, resolvePatternSpec, resolveVisibility, rgbaToHex, rotateAction, rotateAroundAABBCenter, rotatePathAround, rotatePoint, rotatedRectCorners, rotationDegreesUnit, rotationHandle, roundToCell, runsToDom, sampleGradientStops, scaleDelta, scalePathToBounds, sceneFromJSON, sceneNodeClientRect, sceneToAdapter, scopeBindings, scratchKey, selectFromLasso, selectionAtLeast, selectionEmpty, selectionIs, setFlagOverRange, setScratch, shapeCoversPoint, snap, snapPoint, solidVertexColors, spiro, splitPathByLine, splitSubpaths, springPose, springVertexColors, srgbU8ToOklab, staggerVertexColors, starPath, startThresholdDrag, styleAtRange, subscribeImageReady, textCommand, textLineBoxes, tileGrid, toHex8, transformPath, translatePath, translatePolygonInPlace, translatePoseViaDescriptor, tweenPose, tweenVertexColors, unionBounds, unionBoundsPath, useAlign, useAnimator, useArrayAdapter, useAutoCenter, useBooleans, useBooleansAdapter, useCanvasFocus, useCanvasSize, useDecayLoop, useDeviceProfile, useDistribute, useDragGesture, useDragHandle, useDragRadial, useDragRect, useDropZone, useEllipseTool, useEyedropperTool, useGestureDispatcher, useGridCellHover, useGuides, useHandTool, useHandleDrag, useHoverTracking, useImageTool, useKeybindings, useLassoTool, useLineTool, usePenTool, usePencilTool, usePinchGesture, usePinchZoomTool, usePointerStylus, usePolygonTool, usePublishSelection, useRectTool, useResizePolicy, useRotateTool, useScene, useSceneAdapter, useSceneTextEdit, useSelectTool, useSelectionContext, useSimulation, useSliceDep, useStandardActions, useStarTool, useTextEdit, useTextTool, useTools, useVelocityTracker, useViewAnimation, useViewTween, useZoom, viewportDragPanAction, viewportZoomAction, when, withAlpha01, withCoord, withGradientKind, withinPxBox, withinPxRadius, worldEditToStorage, zoomAt, zoomAtLeast };
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { ALWAYS, ANCHOR_HIT_BASE_PX,
|
|
2
|
-
export { routing_exports as routing } from './chunk-
|
|
3
|
-
export { createReparentOp, createTransformOp, deleteScratch, getScratch, scratchKey, setScratch, snap } from './chunk-
|
|
4
|
-
export { CORNER_ANCHORS, cornerPoint, cornerResizeHandles, hitCornerHandle, pointSnapToGrid } from './chunk-
|
|
5
|
-
export { DEFAULT_FLATTEN_TOLERANCE, DEFAULT_GUIDE_TOLERANCE_PX, IMPERIAL_INCHES, METRIC_MM, PATH_C, PATH_CMD_LENGTHS, PATH_L, PATH_M, PATH_Q, PATH_Z, PIXELS, PathBuilder, RECT_ORIGIN_PROJECTION, RECT_POSE_DESCRIPTOR, ROTATED_POSE_DESCRIPTOR, boundsOfPath, ellipsePath, flattenCubic, flattenCubicWithArcLen, flattenQuadratic, flattenQuadraticWithArcLen, formatUnit, gridSnapStrategy, guideSnapStrategy, linePath,
|
|
1
|
+
export { ALWAYS, ANCHOR_HIT_BASE_PX, ActionsProviderIfRoot, ActiveToolContextProvider, ActiveToolContextProviderIfRoot, BUNDLE_TOOLS, COARSE_TARGET_SCALE, CURVE_REPS, ColorOverrideRegistry, CropIcon, CursorCoordsHud, DEFAULT_ALPHA_DECAY, DEFAULT_ALPHA_MIN, DEFAULT_DEBUG_THEME, DEFAULT_DEVICE_PROFILE, DEFAULT_FILL_COLOR, DEFAULT_HANDLE_SIZE, DEFAULT_PALETTE, DEFAULT_ROTATION_HANDLE_DISTANCE, DEFAULT_STROKE_COLOR, DEFAULT_TEXT_STYLE, DEFAULT_VELOCITY_DECAY, DepRegistryProviderIfRoot, DeviceProfileProvider, DivideIcon, EASINGS, EllipseIcon, ExcludeIcon, EyedropperIcon, FALLBACK_FIT_VIEW, GHOST_STROKE, HANDLE_BASE_PX, HandIcon, IDENTITY_POSE_COMPOSITION, IntersectIcon, KIT_SHAPE_KINDS, LassoIcon, LineIcon, MIXED, MOVE_ANCHORS, MinimapCanvas, NEVER, PATH_ANCHOR_CHROME_ID, PenIcon, PencilIcon, PickHud, PointerProviderIfRoot, PolygonIcon, RECT_ALIGN_PROJECTION, ROTATION_HANDLE_BASE_PX, RectIcon, SPRING_PRESETS, SceneCanvas, SceneViewCanvas, SelectIcon, SelectionContextProvider, SelectionContextProviderIfRoot, StarIcon, SubtractIcon, TextIcon, UnionIcon, UnknownIcon, VERSION, WeaselProvider, aabbCenter, actionIs, alignDeltaFor, alignInsertBehavior, alignMoveBehavior, alignResizeBehavior, alignedStrokeRect, always, and, animateLifecycle, animateOnSetPose, annulusSemiAxes, applyBooleanOp, applyHitExistingGate, applyStyleToRange, areaSelectAction, arrayAdapter, asNodeId, bezierCubic, bezierQuadratic, buildChromeCtx, buildRuleCtx, buildSceneViewCommands, canBringForward, canHover, canQueryLocalFonts2 as canQueryLocalFonts, canSendBackward, capabilityAll, capabilityIn, capabilityIs, capabilityNot, caretIndexAt, cellAt, charOffsetToDomPosition, clampView, clearSelectionAction, clientToCanvas, clipboardCopyAction, clipboardCutAction, cloneAction, coarsePointer, composeAffordanceLayer, composePath, composeRectPose, composeSelectionPose, composeWorldPose, computeFitView, computeIndicatorCommand, computeWheelAction, cond, constrainTo45, containedThenNearest, countPathAnchors, createCellHighlightLayer, createChildrenLayer, createCornerResizeAffordance, createDebugOverlayLayer, createDebugSink, createDispatcher, createGridLayer, createGuidesLayer, createHistory, createMarkdownRenderer, createMoveToIndexOp, createNodeProperties, createNodeRouting, createParallaxLayer, createPathAnchorAffordances, createPathEditingOverlayLayer, createPathLayer, createPenPreviewLayer, createReorderOp, createRotationAffordance, createScene, createSelectionHandlesLayer, createSelectionOutlineLayer, createSelectionOverlayLayer, createSetDataOp, createSetLayerOp, createSetPathOp, createSetTextOp, createTextLayer, createViewportLayer, cycleVertexColors, decomposePath, decomposeRectPose, defaultCommitAdapter, defaultDrawOne, defaultLabelTextRenderer, defaultNodeProperties, defaultNodeRouting, defaultVisibilityRules, deriveAlignmentGuides, deriveParallaxView, describeRule, domPositionToCharOffset, domToRuns, drawLayers, easeIn, easeInBack, easeInBounce, easeInCirc, easeInCubic, easeInElastic, easeInExpo, easeInOut, easeInOutBack, easeInOutBounce, easeInOutCirc, easeInOutCubic, easeInOutElastic, easeInOutExpo, easeInOutQuad, easeInOutQuart, easeInOutQuint, easeInOutSine, easeInQuad, easeInQuart, easeInQuint, easeInSine, easeOut, easeOutBack, easeOutBounce, easeOutCirc, easeOutCubic, easeOutElastic, easeOutExpo, easeOutQuad, easeOutQuart, easeOutQuint, easeOutSine, editAnchorsAction, enableLocalFontOutlines2 as enableLocalFontOutlines, enterTextEditAction, enumerateAnchors, evaluate, fillInPoseFrame, fillToBoundsFrame, findNodeShape, findShapeInk, findShapeSilhouette, fitTextPose, fitToBounds, fitViewToBounds, fitZoom, focused, fontString, forEachCoalesced, freeform, gateLayer, gesturing, getAlpha01, getImageBitmap, getNodeShapes, getStylusData, gradientForBounds, gradientGeometry, hasFontOutlines2 as hasFontOutlines, hexToRgba, hitAffordanceRegions, hitAnchor, hitRotationHandle, hovering, hoveringSelected, imageStatus, inferredNodeProperties, inferredNodeRouting, insertAction, isCanvasFont2 as isCanvasFont, isEditableTarget, isPatternSpec, lassoSelectAction, layoutMarkdown, lerpColorArray, lerpOklab, lerpOklch, linear, listFontOutlines2 as listFontOutlines, liveScope, makeViewportZoomAction, markdownToRuns, matchAlignment, matchesKeyBinding, meanScale, measureText, measureTextBounds, measuredWidth, mergeAlphaFromPrev, mergeContributions, modeIn, modeIs, modeNot, modifierHeld, momentum, moveAction, multiActive, nearest, nearestWithin, nestedHitTester, never, nodeHasFlag, none, normalizeHex, not, nurbs, oklabToOklch, oklabToSrgbU8, oklchToOklab, openFilePicker, or, outlineStatus2 as outlineStatus, parseColor, parseColorToRgba255, parseDebugFlags, pathContainsPoint, pathContainsPolygon, pathContainsRect, pathDistanceToPoint, pathDivide, pathExclude, pathFromD, pathInPoseFrame, pathInWorld, pathIntersect, pathIntersectsPolygon, pathIntersectsRect, pathOriginProjection, pathSubtract, pathToAnchors, pathUnion, pickTopMostHit, pinchZoomAction, planPixelRender, pointInRotatedRect, pointInTextPose, poseRotationOf, pressureToWidth, rainbowVertexColors, rebaseLocalPose, rectCorners, registerCanvasFont2 as registerCanvasFont, registerContentHandler, registerFont2 as registerFont, registerFontOutlines2 as registerFontOutlines, registerNodeShape, renderLabel, renderSceneToCanvas, renderSceneToPixels, resizeAction, resolveColor, resolveDeviceProfile, resolveFillPattern, resolvePatternSpec, resolveRuns, resolveTextStyle, resolveVisibility, rgbaToHex, rotateAction, rotateAroundAABBCenter, rotatePathAround, rotatePoint, rotatedRectCorners, rotationDegreesUnit, rotationHandle, roundToCell, runsToDom, runsToMarkdown, runsToPlainText, sampleGradientStops, sceneFromJSON, sceneNodeClientRect, sceneToAdapter, scopeBindings, screenToWorld, selectFromLasso, selectionAtLeast, selectionEmpty, selectionIs, setFlagOverRange, shapeCoversPoint, sliceAction, snapPoint, solidVertexColors, specificity, spiro, splitPathByLine, splitSubpaths, springPose, springVertexColors, srgbU8ToOklab, staggerVertexColors, startThresholdDrag, styleAtRange, subscribeGlyphReady2 as subscribeGlyphReady, subscribeImageReady, textCommand, textLineBoxes, tileGrid, toHex8, toRuns, translatePoseViaDescriptor, translateRectPose, tweenPose, tweenVertexColors, unionBounds, unionBoundsPath, unregisterCanvasFont2 as unregisterCanvasFont, unregisterFontOutlines2 as unregisterFontOutlines, useActiveToolContext, useAlign, useAnimator, useArrayAdapter, useAutoCenter, useBooleans, useBooleansAdapter, useCanvasFocus, useCanvasSize, useDecayLoop, useDeviceProfile, useDistribute, useDragGesture, useDragHandle, useDragRadial, useDragRect, useDropZone, useEllipseTool, useEyedropperTool, useGestureDispatcher, useGridCellHover, useGuides, useHandTool, useHandleDrag, useHoverTracking, useImageTool, useKeybindings, useLassoTool, useLineTool, useOptionalActiveToolContext, usePenTool, usePencilTool, usePinchGesture, usePinchZoomTool, usePointerStylus, usePolygonTool, usePublishSelection, useRectTool, useResizePolicy, useRotateTool, useScene, useSceneAdapter, useSceneTextEdit, useSelectTool, useSelection, useSelectionContext, useSimulation, useSliceDep, useStandardActions, useStarTool, useTextEdit, useTextTool, useTools, useVelocityTracker, useViewAnimation, useViewTween, useZoom, verticalAlignOffset, viewToMat3, viewToTransform, viewportDragPanAction, viewportZoomAction, when, withAlpha01, withCoord, withGradientKind, worldEditToStorage, worldPoseLookup, worldToScreen, zoomAt, zoomAtLeast } from './chunk-D2C6K6FO.js';
|
|
2
|
+
export { ActionDisabledReason, ActionsProvider, DepRegistryProvider, evaluateEnabled, routing_exports as routing, useAction, useActionsRegistry, useDepRegistry, useDepSource, useOptionalDepRegistry } from './chunk-DCIU3SRK.js';
|
|
3
|
+
export { createReparentOp, createTransformOp, deleteScratch, getScratch, scratchKey, setScratch, snap } from './chunk-UB6A6L77.js';
|
|
4
|
+
export { CORNER_ANCHORS, cornerPoint, cornerResizeHandles, hitCornerHandle, pointSnapToGrid } from './chunk-Z3KNFTTS.js';
|
|
5
|
+
export { DEFAULT_FLATTEN_TOLERANCE, DEFAULT_GUIDE_TOLERANCE_PX, IMPERIAL_INCHES, METRIC_MM, PATH_C, PATH_CMD_LENGTHS, PATH_L, PATH_M, PATH_Q, PATH_Z, PIXELS, PathBuilder, RECT_ORIGIN_PROJECTION, RECT_POSE_DESCRIPTOR, ROTATED_POSE_DESCRIPTOR, boundsOfPath, ellipsePath, flattenCubic, flattenCubicWithArcLen, flattenQuadratic, flattenQuadraticWithArcLen, formatUnit, gridSnapStrategy, guideSnapStrategy, linePath, pathPoseDescriptor, pointInPath, pointToGridCell, polygonFromPoints, pxExtent, rectPath, regularPolygonPath, resolveUnit, scaleDelta, scalePathToBounds, starPath, transformPath, translatePath, translatePolygonInPlace, withinPxBox, withinPxRadius } from './chunk-6SHZHXXR.js';
|
|
6
6
|
export { PointerContextProvider, WEASEL_CLIPBOARD_MIME, WEASEL_CLIPBOARD_MIME_WEB, applyOpsTo, buildWeaselClipboardText, dispatchApplyBatch, dlog, dwarn, embedWeaselMetadataInSvg, extractWeaselClipboardFromSvg, isDebugEnabled, parseWeaselClipboardText, sniffWeaselClipboardText, useClipboardOps, usePointerContext } from './chunk-775XXAHR.js';
|
|
7
7
|
export { cloneByAltDrag } from './chunk-UGFFCMQP.js';
|
|
8
8
|
export { createSetSelectionOp } from './chunk-BHVYVFGV.js';
|
|
9
9
|
export { createDeleteOp, createInsertOp, rebuildOp, registerOpFactory } from './chunk-GVCNT7UH.js';
|
|
10
|
-
export { createTilePattern } from './chunk-
|
|
10
|
+
export { createTilePattern } from './chunk-IO5Z75X4.js';
|
|
11
11
|
import './chunk-PZ5AY32C.js';
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
|
13
13
|
//# sourceMappingURL=index.js.map
|
package/dist/insert.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEFAULT_GUIDE_TOLERANCE_PX,
|
|
1
|
+
import { DEFAULT_GUIDE_TOLERANCE_PX, pxExtent } from './chunk-6SHZHXXR.js';
|
|
2
2
|
import './chunk-PZ5AY32C.js';
|
|
3
3
|
|
|
4
4
|
// src/interactions/actions/insert/behaviors/snapToGrid.ts
|
|
@@ -21,7 +21,7 @@ function snapToGrid(args) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// src/interactions/actions/insert/behaviors/snapToGuides.ts
|
|
24
|
-
function snapPoint(p, guides,
|
|
24
|
+
function snapPoint(p, guides, tol) {
|
|
25
25
|
let bestDx = 0;
|
|
26
26
|
let bestAbsDx = Infinity;
|
|
27
27
|
let bestDy = 0;
|
|
@@ -30,14 +30,14 @@ function snapPoint(p, guides, worldTolerance) {
|
|
|
30
30
|
if (g.axis === "x") {
|
|
31
31
|
const d = g.offset - p.x;
|
|
32
32
|
const ad = Math.abs(d);
|
|
33
|
-
if (ad <=
|
|
33
|
+
if (ad <= tol.x && ad < bestAbsDx) {
|
|
34
34
|
bestAbsDx = ad;
|
|
35
35
|
bestDx = d;
|
|
36
36
|
}
|
|
37
37
|
} else {
|
|
38
38
|
const d = g.offset - p.y;
|
|
39
39
|
const ad = Math.abs(d);
|
|
40
|
-
if (ad <=
|
|
40
|
+
if (ad <= tol.y && ad < bestAbsDy) {
|
|
41
41
|
bestAbsDy = ad;
|
|
42
42
|
bestDy = d;
|
|
43
43
|
}
|
|
@@ -53,7 +53,7 @@ function snapToGuides(args) {
|
|
|
53
53
|
const tolerance = args.tolerance ?? DEFAULT_GUIDE_TOLERANCE_PX;
|
|
54
54
|
const getView = args.getView;
|
|
55
55
|
const bypassKey = args.bypassKey;
|
|
56
|
-
const computeWorldTol = () => getView ? tolerance
|
|
56
|
+
const computeWorldTol = () => getView ? pxExtent(tolerance, getView().scale) : { x: tolerance, y: tolerance };
|
|
57
57
|
return {
|
|
58
58
|
onStart(ctx) {
|
|
59
59
|
if (bypassKey && ctx.modifiers[bypassKey]) return;
|