@mmstack/primitives 22.3.0 → 22.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmstack/primitives",
3
- "version": "22.3.0",
3
+ "version": "22.4.0",
4
4
  "keywords": [
5
5
  "angular",
6
6
  "signals",
@@ -189,8 +189,9 @@ declare function providePaused(source: Signal<boolean>): Provider;
189
189
  declare function holdUntilReady<T>(target: Signal<T>, ready: () => boolean): Signal<T>;
190
190
 
191
191
  /**
192
- * Handle for an in-progress transition: a `pending` signal (true while the transition's
193
- * resources are in flight) and a `done` promise that resolves once they all settle.
192
+ * Handle for an in-progress transition: a `pending` signal (true while the transition's OWN
193
+ * resources are in flight loads already in flight when it started are not attributed) and a
194
+ * `done` promise that resolves once they all settle.
194
195
  */
195
196
  type TransitionRef = {
196
197
  readonly pending: Signal<boolean>;
@@ -292,6 +293,15 @@ declare function createForwardingScope(): ForwardingTransitionScope;
292
293
  declare function provideForwardingTransitionScope(): Provider;
293
294
  /** Read the transition scope reachable from `injector`, or null if none is provided there. */
294
295
  declare function getTransitionScope(injector: Injector): TransitionScope | null;
296
+ /**
297
+ * @internal Transaction-attributed pending for `startTransition`/`startTransaction`: like
298
+ * `scope.pending`, but loads already in flight when the tracker is created are NOT attributed —
299
+ * a pre-existing background load can neither settle the transaction early nor block its settle
300
+ * forever. A pre-existing flight is excluded only until it first settles; a later re-trigger of
301
+ * the same resource (e.g. the transaction's write changed its request) counts as the
302
+ * transaction's own work.
303
+ */
304
+ declare function createAttributedPending(scope: TransitionScope): Signal<boolean>;
295
305
  /**
296
306
  * Returns a register function bound to the nearest transition scope: it adds a resource
297
307
  * to the scope and removes it when the caller's injection context is destroyed. Pass any
@@ -342,8 +352,7 @@ declare class SuspenseBoundary extends SuspenseBoundaryBase {
342
352
  }
343
353
  /**
344
354
  * Unscoped suspense boundary — **reads the ambient scope** instead of providing one. For cases where
345
- * the resources to coordinate are registered *above* the boundary (e.g. an app-builder page whose
346
- * manifests/connectors register at a higher injector), so the boundary observes that outer scope
355
+ * the resources to coordinate are registered *above* the boundary so the boundary observes that outer scope
347
356
  * rather than opening a fresh one. Pair with a `provideTransitionScope()` (or another boundary) in an
348
357
  * ancestor.
349
358
  */
@@ -368,7 +377,8 @@ type Transaction = {
368
377
  declare function createTransaction(): Transaction;
369
378
  /** The transaction in effect right now, or `null`. Stateful actions consult this to record undo. */
370
379
  declare function activeTransaction(): Transaction | null;
371
- /** Handle for an in-progress transaction (Tier 3): the transition `pending`/`done`, plus `abort`. */
380
+ /** Handle for an in-progress transaction (Tier 3): the transaction's own `pending`/`done`
381
+ * (loads already in flight at start are not attributed to it), plus `abort`. */
372
382
  type TransactionRef = {
373
383
  readonly pending: Signal<boolean>;
374
384
  readonly done: Promise<void>;
@@ -1945,6 +1955,13 @@ type PointerDragState = {
1945
1955
  * otherwise the listener's element. `null` when idle.
1946
1956
  */
1947
1957
  origin: HTMLElement | null;
1958
+ /**
1959
+ * Whether the LAST gesture ended by being aborted (`pointercancel` /
1960
+ * `lostpointercapture` / Escape / `cancel()`) rather than a normal `pointerup`.
1961
+ * Only meaningful on the idle transition — consumers ending a drag branch on it
1962
+ * to distinguish "drop here" from "abort". Sticky until the next `pointerdown`.
1963
+ */
1964
+ cancelled: boolean;
1948
1965
  };
1949
1966
  type PointerDragOptions = SensorRunOptions & {
1950
1967
  /**
@@ -3249,5 +3266,5 @@ type CreateHistoryOptions<T> = Omit<CreateSignalOptions<T[]>, 'equal'> & {
3249
3266
  */
3250
3267
  declare function withHistory<T>(sourceOrValue: WritableSignal<T> | T, opt?: CreateHistoryOptions<T>): SignalWithHistory<T>;
3251
3268
 
3252
- export { MmActivity, PAUSABLE_OPTIONS, SuspenseBoundary, SuspenseBoundaryBase, UnscopedSuspenseBoundary, activeTransaction, batteryStatus, chunked, clipboard, combineWith, createForwardingScope, createTransaction, createTransitionScope, debounce, debounced, derived, distinct, elementSize, elementVisibility, extendStore, filter, filterWith, focusWithin, forkStore, geolocation, getTransitionScope, holdUntilReady, idle, indexArray, injectPaused, injectRegisterResource, injectStartTransaction, injectStartTransition, injectTransitionScope, isDerivation, isLeaf, isMutable, isOpaque, isStore, keepPrevious, keyArray, map, mapArray, mapObject, mediaQuery, merge3, mousePosition, mutable, mutableStore, nestedEffect, networkStatus, opaque, orientation, pageVisibility, pairwise, pausableComputed, pausableEffect, pausableSignal, pipeable, piped, pointerDrag, pooled, pooledArray, pooledMap, pooledSet, prefersDarkMode, prefersReducedMotion, provideForwardingTransitionScope, providePausableOptions, providePaused, provideTransitionScope, registerResource, resolvePause, scan, scrollPosition, select, sensor, sensors, signalFromEvent, startWith, store, stored, tabSync, tap, throttle, throttled, toFakeDerivation, toFakeSignalDerivation, toStore, toWritable, until, windowSize, withHistory };
3269
+ export { MmActivity, PAUSABLE_OPTIONS, SuspenseBoundary, SuspenseBoundaryBase, UnscopedSuspenseBoundary, activeTransaction, batteryStatus, chunked, clipboard, combineWith, createAttributedPending, createForwardingScope, createTransaction, createTransitionScope, debounce, debounced, derived, distinct, elementSize, elementVisibility, extendStore, filter, filterWith, focusWithin, forkStore, geolocation, getTransitionScope, holdUntilReady, idle, indexArray, injectPaused, injectRegisterResource, injectStartTransaction, injectStartTransition, injectTransitionScope, isDerivation, isLeaf, isMutable, isOpaque, isStore, keepPrevious, keyArray, map, mapArray, mapObject, mediaQuery, merge3, mousePosition, mutable, mutableStore, nestedEffect, networkStatus, opaque, orientation, pageVisibility, pairwise, pausableComputed, pausableEffect, pausableSignal, pipeable, piped, pointerDrag, pooled, pooledArray, pooledMap, pooledSet, prefersDarkMode, prefersReducedMotion, provideForwardingTransitionScope, providePausableOptions, providePaused, provideTransitionScope, registerResource, resolvePause, scan, scrollPosition, select, sensor, sensors, signalFromEvent, startWith, store, stored, tabSync, tap, throttle, throttled, toFakeDerivation, toFakeSignalDerivation, toStore, toWritable, until, windowSize, withHistory };
3253
3270
  export type { BatteryStatus, ClipboardSignal, Computation, CreateChunkedOptions, CreateDebouncedOptions, CreateHistoryOptions, CreatePooledOptions, CreateProvidedPooledOptions, CreateStoredOptions, CreateThrottledOptions, DebouncedSignal, DerivedSignal, ElementSize, ElementSizeOptions, ElementSizeSignal, ElementVisibilityOptions, ElementVisibilitySignal, ExtendStoreOptions, Fork, ForkStoreOptions, ForkStrategy, ForwardingTransitionScope, Frame, GeolocationOptions, GeolocationSignal, IdleOptions, IdleSignal, MousePositionOptions, MousePositionSignal, MutableSignal, MutableSignalStore, NetworkStatusSignal, Opaque, PausableOptions, PauseOption, PipeableSignal, PointerDragOptions, PointerDragSignal, PointerDragState, PointerModifiers, PointerPoint, ReconcileFn, RegisterOptions, ScreenOrientation, ScreenOrientationState, ScrollPosition, ScrollPositionOptions, ScrollPositionSignal, SensorRunOptions, SignalFromEventOptions, SignalStore, SignalWithHistory, StoreOptions, StoredSignal, SuspendType, ThrottledSignal, Transaction, TransactionRef, TransitionRef, TransitionScope, UntilOptions, Vivify, WindowSize, WindowSizeOptions, WindowSizeSignal, WithVivify, WritableSignalStore, toStoreOptions };