@mmstack/primitives 22.1.2 → 22.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@mmstack/primitives",
3
- "version": "22.1.2",
3
+ "version": "22.2.1",
4
4
  "keywords": [
5
5
  "angular",
6
6
  "signals",
7
7
  "debounce",
8
- "mapArray",
8
+ "indexArray",
9
9
  "primitives"
10
10
  ],
11
11
  "license": "MIT",
@@ -56,6 +56,7 @@ declare class MmActivity {
56
56
  private readonly tpl;
57
57
  private readonly vcr;
58
58
  private readonly parent;
59
+ private readonly onServer;
59
60
  /** When false, keep the content mounted but hidden + CD-detached. */
60
61
  readonly visible: i0.InputSignal<boolean>;
61
62
  /** Paused == not visible — handed to the kept subtree as PAUSED_CONTEXT. */
@@ -250,6 +251,20 @@ declare function createTransitionScope(): TransitionScope;
250
251
  /** Provide a fresh transition scope at a boundary so its subtree's resources are tracked independently. */
251
252
  declare function provideTransitionScope(): Provider;
252
253
  declare function injectTransitionScope(): TransitionScope;
254
+ /**
255
+ * A transition scope that can be re-pointed at a delegate target at runtime. Reads and
256
+ * commit/hold follow the current target; `add`/`remove` pin to the target that was current
257
+ * at add-time, so re-pointing between a resource's registration and its destroy-time removal
258
+ * never strands it in the wrong scope. With no target it behaves as a plain own-scope.
259
+ */
260
+ type ForwardingTransitionScope = TransitionScope & {
261
+ setTarget(target: TransitionScope | null): void;
262
+ };
263
+ declare function createForwardingScope(): ForwardingTransitionScope;
264
+ /** Provide a forwarding transition scope at a boundary (used by the transition outlet). */
265
+ declare function provideForwardingTransitionScope(): Provider;
266
+ /** Read the transition scope reachable from `injector`, or null if none is provided there. */
267
+ declare function getTransitionScope(injector: Injector): TransitionScope | null;
253
268
  /**
254
269
  * Returns a register function bound to the nearest transition scope: it adds a resource
255
270
  * to the scope and removes it when the caller's injection context is destroyed. Pass any
@@ -829,7 +844,7 @@ type Frame = {
829
844
  * ]);
830
845
  *
831
846
  * // The fine-grained mapped list
832
- * const mappedUsers = mapArray(
847
+ * const mappedUsers = indexArray(
833
848
  * users,
834
849
  * (userSignal, index) => {
835
850
  * // 1. Create a fine-grained SIDE EFFECT for *this item*
@@ -850,7 +865,7 @@ type Frame = {
850
865
  * };
851
866
  * },
852
867
  * {
853
- * // 3. Tell mapArray HOW to clean up when an item is removed, this needs to be manual as it's not a nestedEffect itself
868
+ * // 3. Tell indexArray HOW to clean up when an item is removed, this needs to be manual as it's not a nestedEffect itself
854
869
  * onDestroy: (mappedItem) => {
855
870
  * mappedItem.destroyEffect();
856
871
  * }
@@ -3030,5 +3045,5 @@ type CreateHistoryOptions<T> = Omit<CreateSignalOptions<T[]>, 'equal'> & {
3030
3045
  */
3031
3046
  declare function withHistory<T>(sourceOrValue: WritableSignal<T> | T, opt?: CreateHistoryOptions<T>): SignalWithHistory<T>;
3032
3047
 
3033
- export { MmActivity, SuspenseBoundary, SuspenseBoundaryBase, UnscopedSuspenseBoundary, activeTransaction, batteryStatus, chunked, clipboard, combineWith, createTransaction, createTransitionScope, debounce, debounced, derived, distinct, elementSize, elementVisibility, filter, filterWith, focusWithin, forkStore, geolocation, 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, pooled, pooledArray, pooledMap, pooledSet, prefersDarkMode, prefersReducedMotion, providePaused, provideTransitionScope, registerResource, resolvePause, scan, scrollPosition, select, sensor, sensors, signalFromEvent, startWith, store, stored, tabSync, tap, throttle, throttled, toFakeDerivation, toFakeSignalDerivation, toStore, toWritable, until, windowSize, withHistory };
3034
- export type { BatteryStatus, ClipboardSignal, Computation, CreateChunkedOptions, CreateDebouncedOptions, CreateHistoryOptions, CreatePooledOptions, CreateProvidedPooledOptions, CreateStoredOptions, CreateThrottledOptions, DebouncedSignal, DerivedSignal, ElementSize, ElementSizeOptions, ElementSizeSignal, ElementVisibilityOptions, ElementVisibilitySignal, Fork, ForkStrategy, Frame, GeolocationOptions, GeolocationSignal, IdleOptions, IdleSignal, MousePositionOptions, MousePositionSignal, MutableSignal, MutableSignalStore, NetworkStatusSignal, Opaque, PausableOptions, PauseOption, PipeableSignal, ReconcileFn, RegisterOptions, ScreenOrientation, ScreenOrientationState, ScrollPosition, ScrollPositionOptions, ScrollPositionSignal, SensorRunOptions, SignalFromEventOptions, SignalStore, SignalWithHistory, StoredSignal, SuspendType, ThrottledSignal, Transaction, TransactionRef, TransitionRef, TransitionScope, UntilOptions, Vivify, WindowSize, WindowSizeOptions, WindowSizeSignal, WithVivify, WritableSignalStore };
3048
+ export { MmActivity, SuspenseBoundary, SuspenseBoundaryBase, UnscopedSuspenseBoundary, activeTransaction, batteryStatus, chunked, clipboard, combineWith, createForwardingScope, createTransaction, createTransitionScope, debounce, debounced, derived, distinct, elementSize, elementVisibility, 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, pooled, pooledArray, pooledMap, pooledSet, prefersDarkMode, prefersReducedMotion, provideForwardingTransitionScope, providePaused, provideTransitionScope, registerResource, resolvePause, scan, scrollPosition, select, sensor, sensors, signalFromEvent, startWith, store, stored, tabSync, tap, throttle, throttled, toFakeDerivation, toFakeSignalDerivation, toStore, toWritable, until, windowSize, withHistory };
3049
+ export type { BatteryStatus, ClipboardSignal, Computation, CreateChunkedOptions, CreateDebouncedOptions, CreateHistoryOptions, CreatePooledOptions, CreateProvidedPooledOptions, CreateStoredOptions, CreateThrottledOptions, DebouncedSignal, DerivedSignal, ElementSize, ElementSizeOptions, ElementSizeSignal, ElementVisibilityOptions, ElementVisibilitySignal, Fork, ForkStrategy, ForwardingTransitionScope, Frame, GeolocationOptions, GeolocationSignal, IdleOptions, IdleSignal, MousePositionOptions, MousePositionSignal, MutableSignal, MutableSignalStore, NetworkStatusSignal, Opaque, PausableOptions, PauseOption, PipeableSignal, ReconcileFn, RegisterOptions, ScreenOrientation, ScreenOrientationState, ScrollPosition, ScrollPositionOptions, ScrollPositionSignal, SensorRunOptions, SignalFromEventOptions, SignalStore, SignalWithHistory, StoredSignal, SuspendType, ThrottledSignal, Transaction, TransactionRef, TransitionRef, TransitionScope, UntilOptions, Vivify, WindowSize, WindowSizeOptions, WindowSizeSignal, WithVivify, WritableSignalStore };