@oh-just-another/state 0.59.0 → 0.61.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 +189 -0
- package/README.md +6 -4
- package/dist/.tsbuildinfo +1 -1
- package/dist/actions/actionArrange.js +4 -4
- package/dist/actions/actionArrange.js.map +1 -1
- package/dist/actions/actionClipboard.d.ts.map +1 -1
- package/dist/actions/actionClipboard.js +5 -0
- package/dist/actions/actionClipboard.js.map +1 -1
- package/dist/actions/actionKeyboard.d.ts.map +1 -1
- package/dist/actions/actionKeyboard.js +79 -11
- package/dist/actions/actionKeyboard.js.map +1 -1
- package/dist/actions/actionMode.d.ts +2 -0
- package/dist/actions/actionMode.d.ts.map +1 -1
- package/dist/actions/actionMode.js +81 -27
- package/dist/actions/actionMode.js.map +1 -1
- package/dist/actions/actionSelection.d.ts.map +1 -1
- package/dist/actions/actionSelection.js +1 -0
- package/dist/actions/actionSelection.js.map +1 -1
- package/dist/actions/actionView.d.ts +6 -0
- package/dist/actions/actionView.d.ts.map +1 -1
- package/dist/actions/actionView.js +19 -1
- package/dist/actions/actionView.js.map +1 -1
- package/dist/actions/actionZoom.d.ts.map +1 -1
- package/dist/actions/actionZoom.js +5 -0
- package/dist/actions/actionZoom.js.map +1 -1
- package/dist/actions/index.d.ts +3 -3
- package/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/index.js +3 -3
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/registry.d.ts.map +1 -1
- package/dist/actions/registry.js +13 -0
- package/dist/actions/registry.js.map +1 -1
- package/dist/actions/types.d.ts +10 -1
- package/dist/actions/types.d.ts.map +1 -1
- package/dist/actions/types.js.map +1 -1
- package/dist/built-in-handlers.d.ts +8 -0
- package/dist/built-in-handlers.d.ts.map +1 -1
- package/dist/built-in-handlers.js +31 -16
- package/dist/built-in-handlers.js.map +1 -1
- package/dist/clipboard.d.ts +0 -14
- package/dist/clipboard.d.ts.map +1 -1
- package/dist/clipboard.js +1 -1
- package/dist/clipboard.js.map +1 -1
- package/dist/constants.d.ts +253 -18
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +255 -2
- package/dist/constants.js.map +1 -1
- package/dist/dom-events.d.ts +1 -2
- package/dist/dom-events.d.ts.map +1 -1
- package/dist/dom-events.js.map +1 -1
- package/dist/editor/animation-scene.d.ts +15 -0
- package/dist/editor/animation-scene.d.ts.map +1 -1
- package/dist/editor/animation-scene.js +159 -0
- package/dist/editor/animation-scene.js.map +1 -1
- package/dist/editor/applies/create.d.ts +0 -6
- package/dist/editor/applies/create.d.ts.map +1 -1
- package/dist/editor/applies/create.js +1 -1
- package/dist/editor/applies/create.js.map +1 -1
- package/dist/editor/applies/link-move.d.ts +0 -8
- package/dist/editor/applies/link-move.d.ts.map +1 -1
- package/dist/editor/applies/link-move.js +1 -1
- package/dist/editor/applies/link-move.js.map +1 -1
- package/dist/editor/event-fanout.d.ts +6 -6
- package/dist/editor/event-fanout.d.ts.map +1 -1
- package/dist/editor/event-fanout.js +8 -8
- package/dist/editor/event-fanout.js.map +1 -1
- package/dist/editor/hit-test.d.ts +8 -0
- package/dist/editor/hit-test.d.ts.map +1 -1
- package/dist/editor/hit-test.js +31 -16
- package/dist/editor/hit-test.js.map +1 -1
- package/dist/editor/interaction-state.d.ts +184 -0
- package/dist/editor/interaction-state.d.ts.map +1 -0
- package/dist/editor/interaction-state.js +139 -0
- package/dist/editor/interaction-state.js.map +1 -0
- package/dist/editor/link-handle-drag.d.ts +172 -0
- package/dist/editor/link-handle-drag.d.ts.map +1 -0
- package/dist/editor/link-handle-drag.js +369 -0
- package/dist/editor/link-handle-drag.js.map +1 -0
- package/dist/editor/pointer-binding.d.ts +9 -11
- package/dist/editor/pointer-binding.d.ts.map +1 -1
- package/dist/editor/pointer-binding.js +1247 -909
- package/dist/editor/pointer-binding.js.map +1 -1
- package/dist/editor/public/brush.d.ts +93 -13
- package/dist/editor/public/brush.d.ts.map +1 -1
- package/dist/editor/public/brush.js +240 -22
- package/dist/editor/public/brush.js.map +1 -1
- package/dist/editor/public/cursor.d.ts +1 -15
- package/dist/editor/public/cursor.d.ts.map +1 -1
- package/dist/editor/public/cursor.js +17 -7
- package/dist/editor/public/cursor.js.map +1 -1
- package/dist/editor/public/eraser.d.ts +55 -0
- package/dist/editor/public/eraser.d.ts.map +1 -0
- package/dist/editor/public/eraser.js +65 -0
- package/dist/editor/public/eraser.js.map +1 -0
- package/dist/editor/public/laser.d.ts +38 -0
- package/dist/editor/public/laser.d.ts.map +1 -0
- package/dist/editor/public/laser.js +42 -0
- package/dist/editor/public/laser.js.map +1 -0
- package/dist/editor/public/placement.d.ts.map +1 -1
- package/dist/editor/public/placement.js +9 -1
- package/dist/editor/public/placement.js.map +1 -1
- package/dist/editor/public/selection-ops.d.ts +12 -0
- package/dist/editor/public/selection-ops.d.ts.map +1 -1
- package/dist/editor/public/selection-ops.js +19 -1
- package/dist/editor/public/selection-ops.js.map +1 -1
- package/dist/editor/public/stroke-eraser-coverage.d.ts +37 -0
- package/dist/editor/public/stroke-eraser-coverage.d.ts.map +1 -0
- package/dist/editor/public/stroke-eraser-coverage.js +168 -0
- package/dist/editor/public/stroke-eraser-coverage.js.map +1 -0
- package/dist/editor/public/stroke-eraser.d.ts +50 -0
- package/dist/editor/public/stroke-eraser.d.ts.map +1 -0
- package/dist/editor/public/stroke-eraser.js +176 -0
- package/dist/editor/public/stroke-eraser.js.map +1 -0
- package/dist/editor/public/stroke-smoothing.d.ts +21 -0
- package/dist/editor/public/stroke-smoothing.d.ts.map +1 -0
- package/dist/editor/public/stroke-smoothing.js +37 -0
- package/dist/editor/public/stroke-smoothing.js.map +1 -0
- package/dist/editor/public/tool-ops.d.ts +130 -0
- package/dist/editor/public/tool-ops.d.ts.map +1 -0
- package/dist/editor/public/tool-ops.js +392 -0
- package/dist/editor/public/tool-ops.js.map +1 -0
- package/dist/editor/public/z-order.d.ts +1 -12
- package/dist/editor/public/z-order.d.ts.map +1 -1
- package/dist/editor/public/z-order.js +1 -1
- package/dist/editor/public/z-order.js.map +1 -1
- package/dist/editor/public/zoom-pan.d.ts +9 -0
- package/dist/editor/public/zoom-pan.d.ts.map +1 -1
- package/dist/editor/public/zoom-pan.js +31 -0
- package/dist/editor/public/zoom-pan.js.map +1 -1
- package/dist/editor/render-orchestrator.d.ts +180 -5
- package/dist/editor/render-orchestrator.d.ts.map +1 -1
- package/dist/editor/render-orchestrator.js +516 -353
- package/dist/editor/render-orchestrator.js.map +1 -1
- package/dist/editor/text-edit.d.ts +136 -0
- package/dist/editor/text-edit.d.ts.map +1 -0
- package/dist/editor/text-edit.js +328 -0
- package/dist/editor/text-edit.js.map +1 -0
- package/dist/editor-events.d.ts +5 -5
- package/dist/editor-events.d.ts.map +1 -1
- package/dist/editor.d.ts +560 -250
- package/dist/editor.d.ts.map +1 -1
- package/dist/editor.js +1650 -743
- package/dist/editor.js.map +1 -1
- package/dist/handle.d.ts +0 -2
- package/dist/handle.d.ts.map +1 -1
- package/dist/handle.js +0 -6
- package/dist/handle.js.map +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/modes.d.ts +34 -1
- package/dist/modes.d.ts.map +1 -1
- package/dist/modes.js.map +1 -1
- package/dist/overlay.d.ts +98 -21
- package/dist/overlay.d.ts.map +1 -1
- package/dist/overlay.js +442 -116
- package/dist/overlay.js.map +1 -1
- package/dist/search.d.ts +37 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +45 -0
- package/dist/search.js.map +1 -0
- package/package.json +5 -4
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1E;;;;;;GAMG;AAC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AAM,uBAAuB,MAAM,CAAC;AAC3C,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAC7C,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAC3C,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C;;;GAGG;AACH,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC;;;;GAIG;AACH,eAAO,MAAM,WAAW,KAAK,CAAC;AAC9B,eAAO,MAAM,WAAW,KAAK,CAAC;AAC9B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,kBAAkB,qBAAqB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,wBAAwB,SAAS,CAAC;AAE/C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,aAAa,KAAK,CAAC;AAChC,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,kBAAkB,OAAO,CAAC;AACvC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,IAAI,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -121,8 +121,8 @@ export const SELECTION_HALO_PEEK_PX = 4;
|
|
|
121
121
|
* brand blue / handle white so anchors share the resize-handle visual
|
|
122
122
|
* language (they equal `DEFAULT_OVERLAY_STYLE.selectionStroke` / `.handleFill`).
|
|
123
123
|
*/
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
const ANCHOR_BRAND_COLOR = "#1a73e8";
|
|
125
|
+
const ANCHOR_NEUTRAL_COLOR = "#fff";
|
|
126
126
|
/** Resting anchor-dot radius (screen px). */
|
|
127
127
|
export const ANCHOR_DOT_RADIUS = 3.5;
|
|
128
128
|
/** Highlighted radius for the hovered / snap-target anchor (screen px). */
|
|
@@ -338,6 +338,13 @@ export const DOUBLE_CLICK_TOLERANCE_PX = 8;
|
|
|
338
338
|
* context.
|
|
339
339
|
*/
|
|
340
340
|
export const ISOLATION_DIM_OPACITY = 0.6;
|
|
341
|
+
/**
|
|
342
|
+
* Opacity of an element MARKED for erasing while the eraser is swept over it
|
|
343
|
+
* (before the delete commits on pointer-up). Much lower than
|
|
344
|
+
* {@link ISOLATION_DIM_OPACITY} so "about to be deleted" reads clearly at a
|
|
345
|
+
* glance — matches the Excalidraw eraser's ~20% preview. Range: 0.15–0.4.
|
|
346
|
+
*/
|
|
347
|
+
export const ERASE_DIM_OPACITY = 0.2;
|
|
341
348
|
/**
|
|
342
349
|
* Opacity of the WYSIWYG shape-draw preview (the live rect / ellipse drawn
|
|
343
350
|
* through its real renderer while dragging out a new shape). Slightly below
|
|
@@ -448,6 +455,193 @@ export const MAX_BRUSH_WIDTH = 6;
|
|
|
448
455
|
* Chromium) so a click-drag still produces a visible stroke.
|
|
449
456
|
*/
|
|
450
457
|
export const DEFAULT_BRUSH_WIDTH = 2;
|
|
458
|
+
/**
|
|
459
|
+
* Default brush line colour — the paint a fresh stroke is committed with when
|
|
460
|
+
* the host hasn't changed the drawing panel. A dark neutral that reads on a
|
|
461
|
+
* light canvas (matches the pre-settings hard-coded value).
|
|
462
|
+
*/
|
|
463
|
+
export const DEFAULT_BRUSH_COLOR = "#222222";
|
|
464
|
+
/**
|
|
465
|
+
* Default brush opacity (0–1) for a fresh stroke. 1 = fully opaque.
|
|
466
|
+
*/
|
|
467
|
+
export const DEFAULT_BRUSH_OPACITY = 1;
|
|
468
|
+
/**
|
|
469
|
+
* Samples per Catmull-Rom span when smoothing a committed brush stroke. Brush
|
|
470
|
+
* points are captured sparsely (one per pointer-move), so the raw polyline is
|
|
471
|
+
* angular; on commit each span is resampled into this many sub-points along a
|
|
472
|
+
* Catmull-Rom curve through the captured points (interpolating per-point width
|
|
473
|
+
* too), baking a smooth stroke into the scene. Higher = smoother but more stored
|
|
474
|
+
* vertices per stroke. Range: 2–8.
|
|
475
|
+
*/
|
|
476
|
+
export const BRUSH_SMOOTH_SEGMENTS = 4;
|
|
477
|
+
/**
|
|
478
|
+
* Input-time low-pass (streamline) strength for brush capture, 0-0.9. Each
|
|
479
|
+
* pointer-move stores a point pulled only `1 - BRUSH_STREAMLINE` of the way
|
|
480
|
+
* from the previous stored point toward the raw sample, filtering hand jitter
|
|
481
|
+
* and sensor noise into a steady line. 0 = raw input (off); higher = steadier
|
|
482
|
+
* but laggier (the commit-time catch-up point hides the lag at the stroke
|
|
483
|
+
* end). Range: 0.3-0.7.
|
|
484
|
+
*/
|
|
485
|
+
export const BRUSH_STREAMLINE = 0.5;
|
|
486
|
+
/**
|
|
487
|
+
* Per-sample lerp rate (0-1) toward the target pressure while capturing a
|
|
488
|
+
* brush stroke — rate-limits pressure changes so a single outlier sample (pen
|
|
489
|
+
* lift-off spike, sudden speed jump on mouse) can't kink the width profile.
|
|
490
|
+
* 1 = follow instantly (off); lower = smoother but slower to adapt. 0.3 keeps
|
|
491
|
+
* the width felt-tip steady. Range: 0.2-0.7.
|
|
492
|
+
*/
|
|
493
|
+
export const BRUSH_PRESSURE_SMOOTHING = 0.3;
|
|
494
|
+
/**
|
|
495
|
+
* Screen-pixel distance per pointer sample at which SIMULATED pressure (mouse /
|
|
496
|
+
* touch — no real pressure channel) bottoms out. Standing still targets full
|
|
497
|
+
* pressure (thick); moving this fast per sample targets the minimum (thin) —
|
|
498
|
+
* the "slower = thicker" response. Measured in screen px so the feel is
|
|
499
|
+
* zoom-independent. 32 keeps the speed response gentle (marker-like); halve it
|
|
500
|
+
* for a livelier calligraphic feel. Range: 8-48.
|
|
501
|
+
*/
|
|
502
|
+
export const BRUSH_SIM_THIN_DIST_PX = 32;
|
|
503
|
+
/**
|
|
504
|
+
* Floor for simulated brush pressure (0-1) — the width multiplier a fast
|
|
505
|
+
* mouse / touch stroke converges to (`× base width`). Together with
|
|
506
|
+
* BRUSH_SIM_PRESSURE_MAX it sets the width band of a simulated stroke: a
|
|
507
|
+
* narrow band (0.55-0.7, the default) reads as a felt-tip marker; widen it
|
|
508
|
+
* (e.g. 0.25-0.8) for a pen-like thin-thick response. Range: 0.15-0.7.
|
|
509
|
+
*/
|
|
510
|
+
export const BRUSH_SIM_PRESSURE_MIN = 0.55;
|
|
511
|
+
/**
|
|
512
|
+
* Ceiling for simulated brush pressure (0-1) — the width multiplier a slow /
|
|
513
|
+
* stationary mouse or touch stroke converges to (`× base width`). Without a
|
|
514
|
+
* ceiling a slow stroke fattens all the way to the full base width, which
|
|
515
|
+
* reads too thick next to the medium-speed line. See BRUSH_SIM_PRESSURE_MIN
|
|
516
|
+
* for the band the two clamps form. Real pen pressure is not clamped.
|
|
517
|
+
* Range: 0.6-1.
|
|
518
|
+
*/
|
|
519
|
+
export const BRUSH_SIM_PRESSURE_MAX = 0.7;
|
|
520
|
+
/**
|
|
521
|
+
* Initial simulated pressure (0-1) for the first sample of a mouse / touch
|
|
522
|
+
* stroke. A felt-tip touches the paper at full width, so it starts at the
|
|
523
|
+
* BRUSH_SIM_PRESSURE_MAX ceiling and thins as the stroke speeds up. Keep
|
|
524
|
+
* within the [MIN, MAX] clamp band. Range: 0.4-0.7.
|
|
525
|
+
*/
|
|
526
|
+
export const BRUSH_SIM_PRESSURE_START = 0.7;
|
|
527
|
+
/**
|
|
528
|
+
* Minimum SCREEN-pixel displacement of the raw input before a new brush point
|
|
529
|
+
* is stored — decimation of near-duplicate pointer samples (120 Hz devices
|
|
530
|
+
* emit far more moves than a stroke needs). Skipped samples still update the
|
|
531
|
+
* commit catch-up point. Smaller = denser capture; larger = coarser but
|
|
532
|
+
* cheaper strokes. Range: 1-4.
|
|
533
|
+
*/
|
|
534
|
+
export const BRUSH_MIN_POINT_DIST_PX = 1.5;
|
|
535
|
+
/**
|
|
536
|
+
* Soft cap on captured brush points per stroke. When capture exceeds it, the
|
|
537
|
+
* stroke's interior points are halved (endpoints kept), bounding memory and
|
|
538
|
+
* render cost on very long strokes — each halving doubles the remaining
|
|
539
|
+
* capacity instead of stopping the stroke. Range: 1024-8192.
|
|
540
|
+
*/
|
|
541
|
+
export const MAX_BRUSH_POINTS = 2048;
|
|
542
|
+
/**
|
|
543
|
+
* Length of the end taper of a brush stroke, as a multiple of the base
|
|
544
|
+
* half-width — arc length from each tip over which the width eases down.
|
|
545
|
+
* Capped at half the stroke length so short strokes stay symmetric. 0 (the
|
|
546
|
+
* default) disables tapering: blunt round caps, the felt-tip marker look.
|
|
547
|
+
* Set 2-5 for pen-like ends that trail off to a point. Range: 0-5.
|
|
548
|
+
*/
|
|
549
|
+
export const BRUSH_TAPER_LENGTH_FACTOR = 0;
|
|
550
|
+
/**
|
|
551
|
+
* Width factor at the very tip of a tapered brush stroke (0-1 of the captured
|
|
552
|
+
* width) — the tip converges to this instead of a full-width round cap,
|
|
553
|
+
* mimicking a pen lifting off. Range: 0.05-0.3.
|
|
554
|
+
*/
|
|
555
|
+
export const BRUSH_TAPER_MIN = 0.1;
|
|
556
|
+
/**
|
|
557
|
+
* World-pixel distance under which a brush stroke's last point is treated as
|
|
558
|
+
* meeting its first — the trigger for auto-closing (and filling) a stroke on
|
|
559
|
+
* commit. Only applies when a fill colour is set and the stroke has ≥3 points.
|
|
560
|
+
* Scaled to the max stroke width so a thick stroke closes as forgivingly as it
|
|
561
|
+
* looks. Range: 6–30; larger closes more eagerly. Default: `MAX_BRUSH_WIDTH * 3`.
|
|
562
|
+
*/
|
|
563
|
+
export const BRUSH_CLOSE_DISTANCE = MAX_BRUSH_WIDTH * 3;
|
|
564
|
+
/**
|
|
565
|
+
* Eraser sampling step in WORLD units. While the eraser is dragged the host
|
|
566
|
+
* hit-tests points spaced this far apart along the pointer path so a fast
|
|
567
|
+
* swipe doesn't skip over small shapes between two move events. Smaller →
|
|
568
|
+
* more hit-tests per move (safer, costlier); larger → cheaper but can jump a
|
|
569
|
+
* thin shape. 6 px matches the default brush width so nothing narrower than a
|
|
570
|
+
* stroke slips through. Range: 3–12.
|
|
571
|
+
*/
|
|
572
|
+
export const ERASER_SAMPLE_STEP = 6;
|
|
573
|
+
/**
|
|
574
|
+
* Stroke colour of the eraser cursor ring (and its fading drag trail). A neutral
|
|
575
|
+
* mid-grey so it reads on both light and dark canvases without looking like a
|
|
576
|
+
* tool accent. Range: any mid-luminance grey (#666–#aaa).
|
|
577
|
+
*/
|
|
578
|
+
export const ERASER_CURSOR_STROKE = "#888888";
|
|
579
|
+
/**
|
|
580
|
+
* Screen-pixel line width of the eraser cursor ring. Constant on screen (the
|
|
581
|
+
* ring is drawn in screen space) so it stays crisp at any zoom. Range: 1–3.
|
|
582
|
+
*/
|
|
583
|
+
export const ERASER_CURSOR_LINE_WIDTH = 1.5;
|
|
584
|
+
/**
|
|
585
|
+
* Lifetime (ms) of an eraser drag-trail point before it fully fades — the knob
|
|
586
|
+
* for how LONG the eraser wake is. Much shorter than {@link LASER_TRAIL_TTL_MS}
|
|
587
|
+
* (the laser comet) so the eraser leaves only a tight, brief wake behind the
|
|
588
|
+
* cursor, matching Excalidraw. Lower = shorter/snappier. Range: 100–400.
|
|
589
|
+
*/
|
|
590
|
+
export const ERASER_TRAIL_TTL_MS = 120;
|
|
591
|
+
/**
|
|
592
|
+
* Stroke-eraser (Shift) samples a brush polyline this densely — as a FRACTION of
|
|
593
|
+
* the eraser radius — when computing which arc-length spans fall under the disc.
|
|
594
|
+
* The eraser cuts the line's GEOMETRY (segments), not just its vertices, so a big
|
|
595
|
+
* disc merely grazing a sparsely-sampled stroke still removes the covered span.
|
|
596
|
+
* Smaller = finer edges / more samples per move; larger = coarser / cheaper. The
|
|
597
|
+
* covered-span endpoints are refined by bisection ({@link ERASE_BOUNDARY_BISECT_ITERS})
|
|
598
|
+
* regardless, so this mainly bounds the miss-a-tiny-dip risk. Range: 0.15–0.5.
|
|
599
|
+
*/
|
|
600
|
+
export const ERASE_COVERAGE_SAMPLE_FRACTION = 0.25;
|
|
601
|
+
/**
|
|
602
|
+
* Floor (world units) for the stroke-eraser sample step, so a tiny eraser radius
|
|
603
|
+
* doesn't explode the sample count on a long stroke. Range: 0.25–2.
|
|
604
|
+
*/
|
|
605
|
+
export const ERASE_COVERAGE_MIN_SAMPLE_STEP = 0.5;
|
|
606
|
+
/**
|
|
607
|
+
* Bisection iterations used to pin each covered-span endpoint to the eraser ring
|
|
608
|
+
* (where the brush polyline crosses distance = radius). Each iteration halves the
|
|
609
|
+
* error, so 10 ≈ step/1024 — visually exact. Range: 6–14.
|
|
610
|
+
*/
|
|
611
|
+
export const ERASE_BOUNDARY_BISECT_ITERS = 10;
|
|
612
|
+
/**
|
|
613
|
+
* A surviving stroke-eraser fragment shorter than this arc length (world units)
|
|
614
|
+
* is dropped as litter — an isolated nub reads as a stray dot, not a line. Range:
|
|
615
|
+
* 0.5–3.
|
|
616
|
+
*/
|
|
617
|
+
export const ERASE_FRAGMENT_MIN_ARC = 1;
|
|
618
|
+
/**
|
|
619
|
+
* Lifetime (ms) of a laser-pointer trail point before it fully fades. Each
|
|
620
|
+
* point stores its birth time; the overlay ramps its opacity from 1 → 0 over
|
|
621
|
+
* this window and the editor prunes points older than it, so a stroke trails
|
|
622
|
+
* the cursor like a comet and vanishes ~this long after the pointer stops.
|
|
623
|
+
* "A couple of seconds" — range 800–3000.
|
|
624
|
+
*/
|
|
625
|
+
export const LASER_TRAIL_TTL_MS = 1400;
|
|
626
|
+
/**
|
|
627
|
+
* Stroke colour of the laser-pointer trail. A saturated red reads as a
|
|
628
|
+
* presentation laser and stands out over any diagram fill.
|
|
629
|
+
*/
|
|
630
|
+
export const LASER_COLOR = "#ff2d2d";
|
|
631
|
+
/**
|
|
632
|
+
* Screen-pixel stroke width of the laser trail. Constant on screen (drawn in
|
|
633
|
+
* screen space, not world) so the beam stays the same thickness at every zoom.
|
|
634
|
+
* Range: 2–6.
|
|
635
|
+
*/
|
|
636
|
+
export const LASER_WIDTH = 4;
|
|
637
|
+
/**
|
|
638
|
+
* Samples per Catmull-Rom span when smoothing a laser trail for rendering.
|
|
639
|
+
* Laser points are collected sparsely (one per pointer-move), so the raw
|
|
640
|
+
* polyline looks angular; the overlay resamples each span into this many
|
|
641
|
+
* sub-points along a Catmull-Rom curve through the captured points, keeping the
|
|
642
|
+
* beam smooth. Higher = smoother but more segments per frame. Range: 4–16.
|
|
643
|
+
*/
|
|
644
|
+
export const LASER_SMOOTH_SEGMENTS = 8;
|
|
451
645
|
/**
|
|
452
646
|
* Default upper bound on the longer edge of a freshly-inserted
|
|
453
647
|
* image (CSS pixels). Larger images get downscaled proportionally
|
|
@@ -457,6 +651,13 @@ export const DEFAULT_BRUSH_WIDTH = 2;
|
|
|
457
651
|
* register their own.
|
|
458
652
|
*/
|
|
459
653
|
export const DEFAULT_IMAGE_MAX_EDGE_PX = 480;
|
|
654
|
+
/**
|
|
655
|
+
* Placeholder size (world px, 16:9) for a dropped video whose metadata never
|
|
656
|
+
* loads (`videoWidth`/`videoHeight` = 0 — unsupported codec, aborted load).
|
|
657
|
+
* Only affects the created element's initial box. Range: 160×90 – 960×540.
|
|
658
|
+
*/
|
|
659
|
+
export const VIDEO_FALLBACK_WIDTH_PX = 480;
|
|
660
|
+
export const VIDEO_FALLBACK_HEIGHT_PX = 270;
|
|
460
661
|
/**
|
|
461
662
|
* Adaptive animation-tick throttling (GIF / video playback). The tick
|
|
462
663
|
* drives a full re-render every frame while an animated shape is
|
|
@@ -536,6 +737,27 @@ export const TEXT_RESIZE_MIN_FONT_SIZE = 4;
|
|
|
536
737
|
* 1.1 ≈ a gentle 10 % step. Range: 1.05–1.5.
|
|
537
738
|
*/
|
|
538
739
|
export const TEXT_FONT_SIZE_STEP = 1.1;
|
|
740
|
+
/**
|
|
741
|
+
* Gap (world px) between a source node and the connected node spawned by the
|
|
742
|
+
* flowchart create shortcut (`Cmd/Ctrl+Arrow`). Measured from the source's
|
|
743
|
+
* edge to the new node's edge along the spawn direction. Range: 40–160 —
|
|
744
|
+
* enough that the connecting link is clearly visible.
|
|
745
|
+
*/
|
|
746
|
+
export const SPAWN_CONNECTED_GAP_PX = 80;
|
|
747
|
+
/**
|
|
748
|
+
* Upper cap on how many sibling nodes a single flowchart create session
|
|
749
|
+
* (`Cmd/Ctrl+Arrow` held, tapped an arrow repeatedly) can pending-grow before
|
|
750
|
+
* commit. Guards against an accidental key-repeat spraying dozens of nodes.
|
|
751
|
+
* Range: 4–16.
|
|
752
|
+
*/
|
|
753
|
+
export const FLOWCHART_MAX_SIBLINGS = 8;
|
|
754
|
+
/**
|
|
755
|
+
* Opacity of the pending flowchart-create preview (the not-yet-committed
|
|
756
|
+
* nodes + links drawn on the overlay while `Cmd/Ctrl` is held). Below 1 so the
|
|
757
|
+
* preview reads as provisional, high enough to judge placement. Range:
|
|
758
|
+
* 0.35–0.65.
|
|
759
|
+
*/
|
|
760
|
+
export const FLOWCHART_PREVIEW_OPACITY = 0.5;
|
|
539
761
|
/**
|
|
540
762
|
* Upper clamp (world px) for font size — matches the property panel's slider
|
|
541
763
|
* ceiling so the keyboard and the panel agree on the maximum.
|
|
@@ -559,4 +781,35 @@ export const GIF_BADGE_BG_COLOR = "rgba(0,0,0,0.65)";
|
|
|
559
781
|
export const LOCK_BADGE_SIZE = 16;
|
|
560
782
|
export const LOCK_BADGE_COLOR = "#1a73e8";
|
|
561
783
|
export const LOCK_BADGE_KEYHOLE_COLOR = "#fff";
|
|
784
|
+
/**
|
|
785
|
+
* Image-crop UX (Excalidraw-style handle cropping).
|
|
786
|
+
*
|
|
787
|
+
* - `CROP_MIN_SIZE` — smallest allowed crop window edge, in element-LOCAL
|
|
788
|
+
* units (unscaled). Dragging an edge handle inward stops here so the window
|
|
789
|
+
* can never collapse to zero. Range: 4–24.
|
|
790
|
+
* - `CROP_HANDLE_HIT_RADIUS` — screen-pixel grab radius around each of the 8
|
|
791
|
+
* crop handles. Divided by zoom before hit-testing so the effective screen
|
|
792
|
+
* target stays constant. Mirrors {@link HANDLE_HIT_SLOP}. Range: 8–14.
|
|
793
|
+
* - `CROP_GHOST_OPACITY` — alpha of the faint full-image "ghost" painted over
|
|
794
|
+
* the virtual full-image rect while cropping, so the user sees the hidden
|
|
795
|
+
* parts of the source. Low so the real (cropped) pixels stay dominant.
|
|
796
|
+
* Range: 0.08–0.2.
|
|
797
|
+
* - `CROP_BRACKET_LEN` — arm length (screen px) of the L-shaped corner brackets
|
|
798
|
+
* that mark the crop frame (Excalidraw-style), drawn instead of round nubs.
|
|
799
|
+
* Range: 10–20.
|
|
800
|
+
* - `CROP_BRACKET_WIDTH` — stroke width (screen px) of those brackets. Thicker
|
|
801
|
+
* than the frame outline so the corners read as grabbable. Range: 2–4.
|
|
802
|
+
*/
|
|
803
|
+
export const CROP_MIN_SIZE = 10;
|
|
804
|
+
export const CROP_HANDLE_HIT_RADIUS = 11;
|
|
805
|
+
export const CROP_GHOST_OPACITY = 0.12;
|
|
806
|
+
export const CROP_BRACKET_LEN = 14;
|
|
807
|
+
export const CROP_BRACKET_WIDTH = 3;
|
|
808
|
+
/**
|
|
809
|
+
* Snap radius (screen px) of the caption drag: while the pill's arc-length
|
|
810
|
+
* position is within this distance of the path middle, the explicit
|
|
811
|
+
* `label.position` is dropped and the label returns to its default placement
|
|
812
|
+
* (midpoint / elbow longest-segment). Range: 4–16.
|
|
813
|
+
*/
|
|
814
|
+
export const LINK_LABEL_DRAG_SNAP_PX = 8;
|
|
562
815
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"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AM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC;AAC9B,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC;AAC9B,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC;AAC/B,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAClC,MAAM,CAAC,MAAM,kBAAkB,GAAG,kBAAkB,CAAC;AAErD;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC;AAClC,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAC1C,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC;AAE/C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC;AAChC,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AACzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC;AACvC,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AACnC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC"}
|
package/dist/dom-events.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { KeyboardEventData,
|
|
1
|
+
import type { KeyboardEventData, PointerEventData, WheelEventData } from "@oh-just-another/types";
|
|
2
2
|
/**
|
|
3
3
|
* Translate a browser `PointerEvent` into a domain `PointerEventData`. The
|
|
4
4
|
* point is expressed in the host element's local CSS-pixel coordinate space
|
|
@@ -16,5 +16,4 @@ export declare const fromWheelEvent: (ev: WheelEvent, host: HTMLElement) => Whee
|
|
|
16
16
|
* when this is true so the user's typing isn't hijacked by canvas shortcuts.
|
|
17
17
|
*/
|
|
18
18
|
export declare const isEditableTarget: (target: EventTarget | null) => boolean;
|
|
19
|
-
export type { KeyPhase };
|
|
20
19
|
//# sourceMappingURL=dom-events.d.ts.map
|
package/dist/dom-events.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom-events.d.ts","sourceRoot":"","sources":["../src/dom-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,
|
|
1
|
+
{"version":3,"file":"dom-events.d.ts","sourceRoot":"","sources":["../src/dom-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EAEjB,gBAAgB,EAGhB,cAAc,EACf,MAAM,wBAAwB,CAAC;AAEhC;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAI,IAAI,YAAY,EAAE,MAAM,WAAW,KAAG,gBAWtE,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,IAAI,aAAa,KAAG,iBAOpD,CAAC;AAEH,eAAO,MAAM,cAAc,GAAI,IAAI,UAAU,EAAE,MAAM,WAAW,KAAG,cAUlE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,WAAW,GAAG,IAAI,KAAG,OAI7D,CAAC"}
|
package/dist/dom-events.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom-events.js","sourceRoot":"","sources":["../src/dom-events.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dom-events.js","sourceRoot":"","sources":["../src/dom-events.ts"],"names":[],"mappings":"AASA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAgB,EAAE,IAAiB,EAAoB,EAAE;IACxF,MAAM,IAAI,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC;IAC1C,OAAO;QACL,IAAI,EAAE,aAAa,CAAC,EAAE,CAAC,WAAW,CAAC;QACnC,KAAK,EAAE,cAAc,CAAC,EAAE,CAAC,IAAI,CAAC;QAC9B,KAAK,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,OAAO,GAAG,IAAI,CAAC,IA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AC,CAAC,MAAM,YAAY,WAAW,CAAC;QAAE,OAAO,KAAK,CAAC;IACnD,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC;IAC3B,OAAO,GAAG,KAAK,OAAO,IAAI,GAAG,KAAK,UAAU,IAAI,GAAG,KAAK,QAAQ,IAAI,MAAM,CAAC,iBAAiB,CAAC;AAC/F,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,EAKpB,EAAa,EAAE,CAAC,CAAC;IAChB,KAAK,EAAE,EAAE,CAAC,QAAQ;IAClB,IAAI,EAAE,EAAE,CAAC,OAAO;IAChB,GAAG,EAAE,EAAE,CAAC,MAAM;IACd,IAAI,EAAE,EAAE,CAAC,OAAO;CACjB,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,CAAC,GAAW,EAAe,EAAE;IACjD,IAAI,GAAG,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IAChC,IAAI,GAAG,KAAK,OAAO;QAAE,OAAO,OAAO,CAAC;IACpC,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,GAAW,EAAgB,EAAE;IACnD,QAAQ,GAAG,EAAE,CAAC;QACZ,KAAK,aAAa;YAChB,OAAO,MAAM,CAAC;QAChB,KAAK,aAAa;YAChB,OAAO,MAAM,CAAC;QAChB,KAAK,WAAW;YACd,OAAO,IAAI,CAAC;QACd,KAAK,eAAe;YAClB,OAAO,QAAQ,CAAC;QAClB,KAAK,cAAc;YACjB,OAAO,OAAO,CAAC;QACjB,KAAK,cAAc;YACjB,OAAO,OAAO,CAAC;QACjB;YACE,OAAO,MAAM,CAAC;IAClB,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -18,4 +18,19 @@ export declare const autoStopHeavyGifs: (editor: Editor) => void;
|
|
|
18
18
|
* Applied directly to `_scene` (no history entry — internal rehydration).
|
|
19
19
|
*/
|
|
20
20
|
export declare const rehydrateAnimatedImages: (editor: Editor) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Restore live image handles for *static* image shapes after a scene load.
|
|
23
|
+
*
|
|
24
|
+
* A live `<img>` / `ImageBitmap` in `metadata.image` does not survive
|
|
25
|
+
* serialisation (the serializer drops it) and the shape's `src` is a dead
|
|
26
|
+
* `blob:` URL once the page reloads — so a restored static image has no
|
|
27
|
+
* drawable handle and the renderer skips it (the "dead-blob-url" warning).
|
|
28
|
+
* The bytes still live in `Scene.files` via `fileId`, so decode them back into
|
|
29
|
+
* a live handle and re-attach it to `metadata.image` before the next paint.
|
|
30
|
+
*
|
|
31
|
+
* Async (decode is async) and applied directly to `_scene` with no history
|
|
32
|
+
* entry — a transient runtime handle, not user data. Repaints once when done.
|
|
33
|
+
* Animated shapes are handled by {@link rehydrateAnimatedImages}.
|
|
34
|
+
*/
|
|
35
|
+
export declare const rehydrateStaticImages: (editor: Editor) => Promise<void>;
|
|
21
36
|
//# sourceMappingURL=animation-scene.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animation-scene.d.ts","sourceRoot":"","sources":["../../src/editor/animation-scene.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"animation-scene.d.ts","sourceRoot":"","sources":["../../src/editor/animation-scene.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GAAI,QAAQ,MAAM,KAAG,OAS1D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,KAAG,IAWlD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,QAAQ,MAAM,KAAG,IAgBxD,CAAC;AAoHF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qBAAqB,GAAU,QAAQ,MAAM,KAAG,OAAO,CAAC,IAAI,CAkCxE,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { bounds as B } from "@oh-just-another/math";
|
|
|
2
2
|
import { apply, getBinaryFile, getElementWorldBounds, isImage } from "@oh-just-another/scene";
|
|
3
3
|
import { HEAVY_GIF_BYTES } from "../constants.js";
|
|
4
4
|
import { hasAnimatedElement } from "./public/image-insert.js";
|
|
5
|
+
import { createHiddenLoopingVideo } from "../built-in-handlers.js";
|
|
5
6
|
/**
|
|
6
7
|
* True when at least one animated shape's world AABB intersects the current
|
|
7
8
|
* viewport. Drives viewport-culling of the animation tick — off-screen GIFs
|
|
@@ -68,4 +69,162 @@ export const rehydrateAnimatedImages = (editor) => {
|
|
|
68
69
|
});
|
|
69
70
|
}
|
|
70
71
|
};
|
|
72
|
+
/**
|
|
73
|
+
* DOM/bitmap constructors that `ctx.drawImage` / `gl.texImage2D` accept as a
|
|
74
|
+
* live image source. Probed by name so a missing global (SSR / worker) is a
|
|
75
|
+
* plain "not live" rather than a throw.
|
|
76
|
+
*/
|
|
77
|
+
const DRAWABLE_CTOR_NAMES = [
|
|
78
|
+
"HTMLImageElement",
|
|
79
|
+
"HTMLCanvasElement",
|
|
80
|
+
"HTMLVideoElement",
|
|
81
|
+
"ImageBitmap",
|
|
82
|
+
"OffscreenCanvas",
|
|
83
|
+
"SVGImageElement",
|
|
84
|
+
"VideoFrame",
|
|
85
|
+
];
|
|
86
|
+
/**
|
|
87
|
+
* True when `value` is a live, drawable image handle (not a `{}` left behind
|
|
88
|
+
* by a serialised `<img>` nor an absent handle). A freshly inserted image
|
|
89
|
+
* already carries one, so rehydration can skip it.
|
|
90
|
+
*/
|
|
91
|
+
const isLiveImageHandle = (value) => {
|
|
92
|
+
if (typeof value !== "object" || value === null)
|
|
93
|
+
return false;
|
|
94
|
+
const g = globalThis;
|
|
95
|
+
for (const name of DRAWABLE_CTOR_NAMES) {
|
|
96
|
+
const ctor = g[name];
|
|
97
|
+
if (typeof ctor === "function" &&
|
|
98
|
+
value instanceof ctor) {
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return false;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Decode raw image bytes into a live drawable handle. Prefers `ImageBitmap`
|
|
106
|
+
* (every backend draws it, incl. the OffscreenCanvas worker); falls back to a
|
|
107
|
+
* decoded `<img>` via an object-URL where `createImageBitmap` is unavailable.
|
|
108
|
+
* Resolves `null` when neither path works (SSR / decode failure).
|
|
109
|
+
*/
|
|
110
|
+
const decodeImageHandle = async (data, mime) => {
|
|
111
|
+
if (typeof Blob === "undefined")
|
|
112
|
+
return null;
|
|
113
|
+
const blob = new Blob([data], { type: mime || "application/octet-stream" });
|
|
114
|
+
if (typeof createImageBitmap === "function") {
|
|
115
|
+
try {
|
|
116
|
+
return await createImageBitmap(blob);
|
|
117
|
+
}
|
|
118
|
+
catch {
|
|
119
|
+
/* fall through to the <img> path (e.g. some SVGs) */
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (typeof Image !== "undefined" &&
|
|
123
|
+
typeof URL !== "undefined" &&
|
|
124
|
+
typeof URL.createObjectURL === "function") {
|
|
125
|
+
const url = URL.createObjectURL(blob);
|
|
126
|
+
return new Promise((resolve) => {
|
|
127
|
+
const img = new Image();
|
|
128
|
+
img.onload = () => {
|
|
129
|
+
resolve(img);
|
|
130
|
+
};
|
|
131
|
+
img.onerror = () => {
|
|
132
|
+
URL.revokeObjectURL(url);
|
|
133
|
+
resolve(null);
|
|
134
|
+
};
|
|
135
|
+
img.src = url;
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
return null;
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Rebuild the live `<video>` handle for a restored video shape: a fresh
|
|
142
|
+
* blob URL over the persisted bytes, mounted as the same hidden, muted,
|
|
143
|
+
* looping element the drop handler creates. Resolves when the element has
|
|
144
|
+
* its first frame (or `null` on error / SSR); playback resumes best-effort
|
|
145
|
+
* (autoplay may need a user gesture — the muted flag usually suffices).
|
|
146
|
+
*/
|
|
147
|
+
const rehydrateVideoHandle = async (data, mime) => {
|
|
148
|
+
if (typeof document === "undefined" ||
|
|
149
|
+
typeof URL === "undefined" ||
|
|
150
|
+
typeof URL.createObjectURL !== "function") {
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
const url = URL.createObjectURL(new Blob([data], { type: mime }));
|
|
154
|
+
const video = createHiddenLoopingVideo(url);
|
|
155
|
+
const ok = await new Promise((resolve) => {
|
|
156
|
+
video.onloadedmetadata = () => {
|
|
157
|
+
resolve(true);
|
|
158
|
+
};
|
|
159
|
+
video.onerror = () => {
|
|
160
|
+
resolve(false);
|
|
161
|
+
};
|
|
162
|
+
});
|
|
163
|
+
if (!ok) {
|
|
164
|
+
URL.revokeObjectURL(url);
|
|
165
|
+
video.remove();
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
void video.play().catch(() => {
|
|
169
|
+
/* intentional no-op: autoplay rejection is expected before user interaction */
|
|
170
|
+
});
|
|
171
|
+
return video;
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* Restore live image handles for *static* image shapes after a scene load.
|
|
175
|
+
*
|
|
176
|
+
* A live `<img>` / `ImageBitmap` in `metadata.image` does not survive
|
|
177
|
+
* serialisation (the serializer drops it) and the shape's `src` is a dead
|
|
178
|
+
* `blob:` URL once the page reloads — so a restored static image has no
|
|
179
|
+
* drawable handle and the renderer skips it (the "dead-blob-url" warning).
|
|
180
|
+
* The bytes still live in `Scene.files` via `fileId`, so decode them back into
|
|
181
|
+
* a live handle and re-attach it to `metadata.image` before the next paint.
|
|
182
|
+
*
|
|
183
|
+
* Async (decode is async) and applied directly to `_scene` with no history
|
|
184
|
+
* entry — a transient runtime handle, not user data. Repaints once when done.
|
|
185
|
+
* Animated shapes are handled by {@link rehydrateAnimatedImages}.
|
|
186
|
+
*/
|
|
187
|
+
export const rehydrateStaticImages = async (editor) => {
|
|
188
|
+
const targets = [];
|
|
189
|
+
for (const shape of editor._scene.elements.values()) {
|
|
190
|
+
if (!isImage(shape))
|
|
191
|
+
continue;
|
|
192
|
+
if (shape.animationKind)
|
|
193
|
+
continue; // animated path rebuilds via animationData
|
|
194
|
+
if (isLiveImageHandle(shape.metadata?.image))
|
|
195
|
+
continue; // freshly inserted — already live
|
|
196
|
+
if (!shape.fileId)
|
|
197
|
+
continue;
|
|
198
|
+
const file = getBinaryFile(editor._scene, shape.fileId);
|
|
199
|
+
if (!file)
|
|
200
|
+
continue;
|
|
201
|
+
targets.push({ id: shape.id, data: file.data, mime: file.mime });
|
|
202
|
+
}
|
|
203
|
+
if (targets.length === 0)
|
|
204
|
+
return;
|
|
205
|
+
let changed = false;
|
|
206
|
+
for (const target of targets) {
|
|
207
|
+
const handle = target.mime.startsWith("video/")
|
|
208
|
+
? await rehydrateVideoHandle(target.data, target.mime)
|
|
209
|
+
: await decodeImageHandle(target.data, target.mime);
|
|
210
|
+
if (!handle)
|
|
211
|
+
continue;
|
|
212
|
+
// The scene may have mutated while decoding — re-read the current shape
|
|
213
|
+
// and skip if it vanished or already regained a live handle.
|
|
214
|
+
const shape = editor._scene.elements.get(target.id);
|
|
215
|
+
if (!shape || !isImage(shape))
|
|
216
|
+
continue;
|
|
217
|
+
if (isLiveImageHandle(shape.metadata?.image))
|
|
218
|
+
continue;
|
|
219
|
+
editor._scene = apply(editor._scene, {
|
|
220
|
+
kind: "element",
|
|
221
|
+
id: shape.id,
|
|
222
|
+
before: shape,
|
|
223
|
+
after: { ...shape, metadata: { ...shape.metadata, image: handle } },
|
|
224
|
+
});
|
|
225
|
+
changed = true;
|
|
226
|
+
}
|
|
227
|
+
if (changed)
|
|
228
|
+
editor.forceRender();
|
|
229
|
+
};
|
|
71
230
|
//# sourceMappingURL=animation-scene.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animation-scene.js","sourceRoot":"","sources":["../../src/editor/animation-scene.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,KA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;QAAE,OAAO;IAEjC,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;YAC7C,CAAC,CAAC,MAAM,oBAAoB,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC;YACtD,CAAC,CAAC,MAAM,iBAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;QACtD,IAAI,CAAC,MAAM;YAAE,SAAS;QACtB,wEAAwE;QACxE,6DAA6D;QAC7D,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACpD,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;YAAE,SAAS;QACxC,IAAI,iBAAiB,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC;YAAE,SAAS;QACvD,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE;YACnC,IAAI,EAAE,SAAS;YACf,EAAE,EAAE,KAAK,CAAC,EAAE;YACZ,MAAM,EAAE,KAAK;YACb,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,EAAE,GAAG,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;SACpE,CAAC,CAAC;QACH,OAAO,GAAG,IAAI,CAAC;IACjB,CAAC;IACD,IAAI,OAAO;QAAE,MAAM,CAAC,WAAW,EAAE,CAAC;AACpC,CAAC,CAAC"}
|
|
@@ -9,12 +9,6 @@ import type { Bounds, LinkId, LayerId, ElementId, Vec2 } from "@oh-just-another/
|
|
|
9
9
|
* stack as usual.
|
|
10
10
|
*/
|
|
11
11
|
export declare const buildElementForCreate: (scene: Scene, kind: "rect" | "ellipse" | "frame", bounds: Bounds, id: ElementId, layerId: LayerId, nextFrameName: () => string) => Element;
|
|
12
|
-
/**
|
|
13
|
-
* Build the `Link` object for a CREATE_EDGE emit. Endpoints are
|
|
14
|
-
* pre-resolved (snapped) by the caller — we just compose them with the
|
|
15
|
-
* layer / order / style boilerplate.
|
|
16
|
-
*/
|
|
17
|
-
export declare const buildLinkForCreate: (scene: Scene, from: LinkEndpoint, to: LinkEndpoint, id: LinkId, layerId: LayerId) => Link;
|
|
18
12
|
/**
|
|
19
13
|
* Build the throwaway `Link` for the live draw-edge connector preview.
|
|
20
14
|
* Same default object as {@link buildLinkForCreate} (so the dragged preview is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/editor/applies/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,IAAI,EACT,KAAK,YAAY,EACjB,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,KAAK,EACX,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAevF;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,GAChC,OAAO,KAAK,EACZ,MAAM,MAAM,GAAG,SAAS,GAAG,OAAO,EAClC,QAAQ,MAAM,EACd,IAAI,SAAS,EACb,SAAS,OAAO,EAChB,eAAe,MAAM,MAAM,KAC1B,OAwBF,CAAC;
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/editor/applies/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,IAAI,EACT,KAAK,YAAY,EACjB,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,KAAK,EACX,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,IAA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AM,SAAS,GAAI,MAAM,MAAM,KAAG,MACY,CAAC"}
|
|
@@ -46,7 +46,7 @@ export const buildElementForCreate = (scene, kind, bounds, id, layerId, nextFram
|
|
|
46
46
|
* pre-resolved (snapped) by the caller — we just compose them with the
|
|
47
47
|
* layer / order / style boilerplate.
|
|
48
48
|
*/
|
|
49
|
-
|
|
49
|
+
const buildLinkForCreate = (scene, from, to, id, layerId) => {
|
|
50
50
|
const order = orderForTop(Array.from(scene.links.values())
|
|
51
51
|
.filter((e) => e.layerId === layerId)
|
|
52
52
|
.map((e) => e.order));
|