@weasel-js/core 1.5.2 → 1.6.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.
@@ -1,6 +1,7 @@
1
1
  import { NodeId } from '@weasel-js/routing';
2
- import { C as ClipboardSnapshot, I as InsertAdapter } from './types-BdaK9PcP.js';
2
+ import { C as ClipboardSnapshot, I as InsertAdapter } from './types-CxC8P6W0.js';
3
3
  import '@weasel-js/history';
4
+ import './path-JEV2c5If.js';
4
5
 
5
6
  type Replacer$1 = (key: string, value: unknown) => unknown;
6
7
  /** Options for `useClipboardOps`. */
package/dist/clone.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { C as CloneBehavior } from './types-BHGdrOcu.js';
1
+ import { C as CloneBehavior } from './types-D_74YlWs.js';
2
2
  import '@weasel-js/history';
3
- import './types-BdaK9PcP.js';
3
+ import './types-CxC8P6W0.js';
4
+ import './path-JEV2c5If.js';
4
5
  import '@weasel-js/routing';
5
6
 
6
7
  /** Clone-on-alt-drag behavior for `useClone`; activates when Alt/Option is held at drag start. */
@@ -1,13 +1,14 @@
1
1
  import { GradStop, ColorSpace, TextureHandle, FillStyle, Stroke, ScreenLength } from '@weasel-js/paint';
2
2
  import { NodeId, Bounds, View, SelectionApi, ActionDeps, IngestItem, DragSample, Point2 } from '@weasel-js/routing';
3
- import { a as Path, P as PoseDescriptor } from './poseDescriptor-PgfVKfa0.js';
3
+ import { P as Path } from './path-JEV2c5If.js';
4
4
  import { ResolvedRun, TextStyle, TextVerticalAlign } from '@weasel-js/text';
5
5
  import { Mat3 } from '@weasel-js/geom';
6
6
  import * as _weasel_js_history from '@weasel-js/history';
7
7
  import { Op, History, SerializedHistory } from '@weasel-js/history';
8
- import { a as SceneAdapter, L as LayoutStrategy, I as InsertAdapter } from './types-BdaK9PcP.js';
8
+ import { a as SceneAdapter, L as LayoutStrategy, b as LayoutDropTargetMode, I as InsertAdapter } from './types-CxC8P6W0.js';
9
+ import { P as PoseDescriptor } from './poseDescriptor-rZa9W5hJ.js';
9
10
  import { ActiveToolContextValue } from '@weasel-js/routing/react';
10
- import { B as BoundsConstraint, P as PointSnapBehavior } from './types-BHGdrOcu.js';
11
+ import { B as BoundsConstraint, P as PointSnapBehavior } from './types-D_74YlWs.js';
11
12
 
12
13
  /**
13
14
  * Axis-aligned rectangle pose with optional rotation. The canonical pose
@@ -827,7 +828,8 @@ declare class GLTextureCache {
827
828
  *
828
829
  * Key: ImageBitmap (or pattern source object) identity (WeakMap) — lets GC
829
830
  * reclaim unreferenced bitmaps. The GL textures are NOT freed when the source
830
- * is gc'd; deferred to v2.
831
+ * is gc'd; a source's owner that knows it will never be drawn again frees them
832
+ * with {@link releaseImageSource}.
831
833
  *
832
834
  * Wrapping is set once at upload time per the `repetition` parameter:
833
835
  * - undefined / 'no-repeat' → CLAMP_TO_EDGE
@@ -844,6 +846,8 @@ type TexSource = ImageBitmap | ImageData | HTMLCanvasElement | HTMLImageElement;
844
846
  declare class GLImageCache {
845
847
  private readonly gl;
846
848
  private readonly minification;
849
+ /** This context's `MAX_TEXTURE_SIZE`. */
850
+ readonly maxTextureSide: number;
847
851
  private readonly map;
848
852
  /**
849
853
  * MAG_FILTER each texture currently carries, so a redundant write can be
@@ -869,6 +873,11 @@ declare class GLImageCache {
869
873
  * headless print/export path); bilinear-only minification undersamples
870
874
  * and produces moiré. */
871
875
  constructor(gl: WebGL2RenderingContext, minification?: ImageMinification);
876
+ /** Delete `key`'s texture, if it has one. */
877
+ release(key: object): void;
878
+ /** Stop answering {@link releaseImageSource} and {@link maxImageTextureSide}.
879
+ * Call when the context is disposed or lost. */
880
+ dispose(): void;
872
881
  upload(key: object, source: TexSource, repetition?: PatternRepetition): WebGLTexture;
873
882
  bind(key: object, unit: number): void;
874
883
  /** Set `key`'s MAG_FILTER, skipping the call when it already holds that
@@ -2589,6 +2598,10 @@ declare function useViewAnimationOn(view: ViewChannel, animator: Animator): View
2589
2598
  interface PoseAdapter<TPose> {
2590
2599
  getPose(id: string): TPose;
2591
2600
  getParent(id: string): string | null;
2601
+ /** Whether `id`'s pose is a frame its children are expressed in. Absent
2602
+ * means every node is one. A container whose pose derives from its children
2603
+ * is not: its children share its frame, so the fold passes over it. */
2604
+ definesFrame?(id: string): boolean;
2592
2605
  }
2593
2606
  /**
2594
2607
  * The transforms a `compose` represents **exactly**. A parent transform wider
@@ -2965,6 +2978,12 @@ interface EditAnchorsDep {
2965
2978
  * (when the polygon lives on data.path). Records one history entry
2966
2979
  * labelled `label`. */
2967
2980
  applyEdit(id: string, worldPath: unknown, label: string): void;
2981
+ /** The ops `applyEdit` would commit for the same arguments, unapplied, so
2982
+ * a caller can make the edit part of a larger batch — the pen joining
2983
+ * two paths edits one node and deletes the other in one undo step.
2984
+ * Optional; a caller that needs it declines the composite edit without
2985
+ * it. Returns `[]` when `id` has no editable polygon. */
2986
+ editOps?(id: string, worldPath: unknown, label: string): Op[];
2968
2987
  /**
2969
2988
  * Anchors currently selected within the edited path, as **flat anchor
2970
2989
  * indices** — the same numbering `enumerateAnchors` produces and the
@@ -3237,6 +3256,9 @@ interface ResizePolicy<TPose> {
3237
3256
  */
3238
3257
  interface LayoutDep {
3239
3258
  getLayout(containerId: string): LayoutStrategy<unknown> | null;
3259
+ /** Which container wins when several contain the drop point. Default
3260
+ * `'innermost'`. */
3261
+ dropTarget?: LayoutDropTargetMode;
3240
3262
  }
3241
3263
  /**
3242
3264
  * Dep for `enterTextEditAction`.
@@ -1,4 +1,4 @@
1
- import { M as MoveBehavior, S as SnapStrategy } from './types-BHGdrOcu.js';
1
+ import { M as MoveBehavior, S as SnapStrategy } from './types-D_74YlWs.js';
2
2
  import { DebugSink } from '@weasel-js/routing';
3
3
 
4
4
  /**