@tempots/dom 37.4.1 → 37.5.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": "@tempots/dom",
3
- "version": "37.4.1",
3
+ "version": "37.5.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "main": "./index.cjs",
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "license": "Apache-2.0",
17
17
  "dependencies": {
18
- "@tempots/core": "^3.2.1",
19
- "@tempots/render": "^0.0.8"
18
+ "@tempots/core": "^3.3.0",
19
+ "@tempots/render": "^0.0.9"
20
20
  },
21
21
  "description": "Fully-typed frontend framework alternative to React and Angular",
22
22
  "keywords": [
@@ -0,0 +1 @@
1
+ export { Catch } from './shared';
@@ -1,7 +1,7 @@
1
1
  import { Providers, Renderable } from '../types/domain';
2
2
  import { DOMContext } from '../dom/dom-context';
3
3
  import { HeadlessPortal } from '../dom/headless-context';
4
- import { Value } from '@tempots/core';
4
+ import { DisposalScope, Value } from '@tempots/core';
5
5
  /**
6
6
  * Renders the given `renderable` with the provided `ctx` DOM context.
7
7
  *
@@ -14,7 +14,7 @@ import { Value } from '@tempots/core';
14
14
  * @returns A function that can be called to clear the rendered node.
15
15
  * @public
16
16
  */
17
- export declare const renderWithContext: (renderable: Renderable, ctx: DOMContext) => (removeTree?: boolean) => void;
17
+ export declare const renderWithContext: (renderable: Renderable, ctx: DOMContext, onScope?: (scope: DisposalScope) => void) => (removeTree?: boolean) => void;
18
18
  /**
19
19
  * Options for rendering.
20
20
  * @public
@@ -36,6 +36,11 @@ export type RenderOptions = {
36
36
  * The providers to use for the renderable.
37
37
  */
38
38
  providers?: Providers;
39
+ /**
40
+ * Callback to capture the DisposalScope created during rendering.
41
+ * Used by HMR runtime for signal introspection.
42
+ */
43
+ onScope?: (scope: DisposalScope) => void;
39
44
  };
40
45
  /**
41
46
  * Renders a `Renderable` node into a specified parent element or selector.
@@ -47,7 +52,7 @@ export type RenderOptions = {
47
52
  * @throws Throws a `RenderingError` if the parent element cannot be found by the provided selector.
48
53
  * @public
49
54
  */
50
- export declare const render: (node: Renderable, parent: Node | string, { doc, clear, disposeWithParent, providers }?: RenderOptions) => () => void;
55
+ export declare const render: (node: Renderable, parent: Node | string, { doc, clear, disposeWithParent, providers, onScope, }?: RenderOptions) => () => void;
51
56
  /**
52
57
  * Options for running a headless environment.
53
58
  * @public
@@ -8,4 +8,4 @@ export declare const Empty: import('@tempots/core').Renderable<DOMContext, typeo
8
8
  }>(match: import('@tempots/core').Value<T>, cases: import('@tempots/render').OneOfTypeOptions<T, DOMContext, typeof DOM_RENDERABLE_TYPE>) => import('@tempots/core').Renderable<DOMContext, typeof DOM_RENDERABLE_TYPE>, OneOfValue: <T extends symbol | number | string>(match: import('@tempots/core').Value<T>, cases: import('@tempots/render').OneOfValueOptions<T, DOMContext, typeof DOM_RENDERABLE_TYPE>) => import('@tempots/core').Renderable<DOMContext, typeof DOM_RENDERABLE_TYPE>, OneOfTuple: <T extends string, V>(match: import('@tempots/core').Value<[T, V]>, cases: import('@tempots/render').OneOfTupleOptions<T, V, DOMContext, typeof DOM_RENDERABLE_TYPE>) => import('@tempots/core').Renderable<DOMContext, typeof DOM_RENDERABLE_TYPE>, MapSignal: <T>(value: import('@tempots/core').Value<T>, fn: (value: T) => import('@tempots/core').TNode<DOMContext, typeof DOM_RENDERABLE_TYPE>) => import('@tempots/core').Renderable<DOMContext, typeof DOM_RENDERABLE_TYPE>, MapText: <T>(source: import('@tempots/core').Signal<T>, fn: (value: T) => string) => import('@tempots/core').Renderable<DOMContext, typeof DOM_RENDERABLE_TYPE>, Ensure: <T>(value: import('@tempots/render').NillifyValue<T>, then: (value: import('@tempots/core').Signal<T & {} extends infer T_1 ? { [P in keyof T_1]: T_1[P]; } : never>) => import('@tempots/core').TNode<DOMContext, typeof DOM_RENDERABLE_TYPE>, otherwise?: (() => import('@tempots/core').TNode<DOMContext, typeof DOM_RENDERABLE_TYPE>) | undefined) => import('@tempots/core').Renderable<DOMContext, typeof DOM_RENDERABLE_TYPE>, EnsureAll: <T extends readonly import('@tempots/core').Value<unknown>[]>(...signals: { [K in keyof T]: import('@tempots/render').NillifyValue<T[K]>; }) => (callback: (...values: { [K_1 in keyof T]: import('@tempots/core').Signal<(T[K_1] extends import('@tempots/core').Value<infer U> ? U : never) & {} extends infer T_1 ? { [P in keyof T_1]: T_1[P]; } : never>; }) => import('@tempots/core').TNode<DOMContext, typeof DOM_RENDERABLE_TYPE>, otherwise?: (() => import('@tempots/core').TNode<DOMContext, typeof DOM_RENDERABLE_TYPE>) | undefined) => import('@tempots/core').Renderable<DOMContext, typeof DOM_RENDERABLE_TYPE>, NotEmpty: <T>(value: import('@tempots/core').Value<T[]>, display: (value: import('@tempots/core').Signal<T[]>) => import('@tempots/core').Renderable<DOMContext, typeof DOM_RENDERABLE_TYPE>, whenEmpty?: (() => import('@tempots/core').Renderable<DOMContext, typeof DOM_RENDERABLE_TYPE>) | undefined) => import('@tempots/core').Renderable<DOMContext, typeof DOM_RENDERABLE_TYPE>, Task: <T>(task: () => Promise<T>, options: import('@tempots/render').TaskOptions<T, DOMContext, typeof DOM_RENDERABLE_TYPE> | ((value: T) => import('@tempots/core').TNode<DOMContext, typeof DOM_RENDERABLE_TYPE>)) => import('@tempots/core').Renderable<DOMContext, typeof DOM_RENDERABLE_TYPE>, Async: <T>(promise: Promise<T>, options: import('@tempots/render').AsyncOptions<T, DOMContext, typeof DOM_RENDERABLE_TYPE> | ((value: T) => import('@tempots/core').TNode<DOMContext, typeof DOM_RENDERABLE_TYPE>)) => import('@tempots/core').Renderable<DOMContext, typeof DOM_RENDERABLE_TYPE>, OnDispose: (...fns: (import('@tempots/render').DisposeCallback<DOMContext> | import('@tempots/render').WithDispose<DOMContext>)[]) => import('@tempots/core').Renderable<DOMContext, typeof DOM_RENDERABLE_TYPE>, Conjunction: (separator: () => import('@tempots/core').TNode<DOMContext, typeof DOM_RENDERABLE_TYPE>, options?: import('@tempots/render').ConjunctionOptions<DOMContext, typeof DOM_RENDERABLE_TYPE> | undefined) => (pos: import('@tempots/core').Signal<import('@tempots/core').ElementPosition>) => import('@tempots/core').Renderable<DOMContext, typeof DOM_RENDERABLE_TYPE>, WithScope: (fn: (scope: import('@tempots/core').DisposalScope) => import('@tempots/core').TNode<DOMContext, typeof DOM_RENDERABLE_TYPE>) => import('@tempots/core').Renderable<DOMContext, typeof DOM_RENDERABLE_TYPE>, WithProvider: (fn: (opts: import('@tempots/render').ProviderOptions<DOMContext>) => void | import('@tempots/core').TNode<DOMContext, typeof DOM_RENDERABLE_TYPE>) => import('@tempots/core').Renderable<DOMContext, typeof DOM_RENDERABLE_TYPE>, Provide: <T, O>(provider: import('@tempots/render').Provider<T, O, DOMContext>, options: O, child: () => import('@tempots/core').TNode<DOMContext, typeof DOM_RENDERABLE_TYPE>) => import('@tempots/core').Renderable<DOMContext, typeof DOM_RENDERABLE_TYPE>, Use: <T>(provider: import('@tempots/render').Provider<T, unknown, DOMContext>, child: (provider: T) => import('@tempots/core').TNode<DOMContext, typeof DOM_RENDERABLE_TYPE>) => import('@tempots/core').Renderable<DOMContext, typeof DOM_RENDERABLE_TYPE>, UseMany: <P extends import('@tempots/render').Provider<unknown, unknown, DOMContext>[]>(...providers: P) => (child: (...values: import('@tempots/render').ToProviderTypes<P>) => import('@tempots/core').TNode<DOMContext, typeof DOM_RENDERABLE_TYPE>) => import('@tempots/core').Renderable<DOMContext, typeof DOM_RENDERABLE_TYPE>, UseOptional: {
9
9
  <T>(provider: import('@tempots/render').Provider<T, unknown, DOMContext>, child: (value: T | undefined) => import('@tempots/core').TNode<DOMContext, typeof DOM_RENDERABLE_TYPE>): import('@tempots/core').Renderable<DOMContext, typeof DOM_RENDERABLE_TYPE>;
10
10
  <T>(provider: import('@tempots/render').Provider<T, unknown, DOMContext>, fallback: T, child: (value: T) => import('@tempots/core').TNode<DOMContext, typeof DOM_RENDERABLE_TYPE>): import('@tempots/core').Renderable<DOMContext, typeof DOM_RENDERABLE_TYPE>;
11
- }, handleValueOrSignal: <T, R>(value: import('@tempots/core').Value<T>, onSignal: (signal: import('@tempots/core').Signal<T>) => R, onStatic: (literal: T) => R) => R, createReactiveRenderable: <T>(ctx: DOMContext, signal: import('@tempots/core').Signal<T>, render: (value: T) => import('@tempots/core').TNode<DOMContext, typeof DOM_RENDERABLE_TYPE>) => import('@tempots/core').Clear, renderableOfTNode: (child: import('@tempots/core').TNode<DOMContext, typeof DOM_RENDERABLE_TYPE>) => import('@tempots/core').Renderable<DOMContext, typeof DOM_RENDERABLE_TYPE>;
11
+ }, Catch: (children: import('@tempots/core').TNode<DOMContext, typeof DOM_RENDERABLE_TYPE>, fallback: (error: import('@tempots/core').Signal<Error>, retry: () => void) => import('@tempots/core').TNode<DOMContext, typeof DOM_RENDERABLE_TYPE>) => import('@tempots/core').Renderable<DOMContext, typeof DOM_RENDERABLE_TYPE>, handleValueOrSignal: <T, R>(value: import('@tempots/core').Value<T>, onSignal: (signal: import('@tempots/core').Signal<T>) => R, onStatic: (literal: T) => R) => R, createReactiveRenderable: <T>(ctx: DOMContext, signal: import('@tempots/core').Signal<T>, render: (value: T) => import('@tempots/core').TNode<DOMContext, typeof DOM_RENDERABLE_TYPE>) => import('@tempots/core').Clear, renderableOfTNode: (child: import('@tempots/core').TNode<DOMContext, typeof DOM_RENDERABLE_TYPE>) => import('@tempots/core').Renderable<DOMContext, typeof DOM_RENDERABLE_TYPE>;