@tempots/dom 34.2.0 → 35.0.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/index.cjs +1 -1
- package/index.d.ts +2 -2
- package/index.js +411 -354
- package/package.json +2 -2
- package/renderable/iframe.d.ts +8 -4
- package/types/domain.d.ts +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tempots/dom",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "35.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.cjs",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -37,6 +37,6 @@
|
|
|
37
37
|
"url": "git+https://github.com/fponticelli/tempots.git"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@tempots/core": "^
|
|
40
|
+
"@tempots/core": "^2.0.0"
|
|
41
41
|
}
|
|
42
42
|
}
|
package/renderable/iframe.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TNode, Value } from '../types/domain';
|
|
1
|
+
import { SplitValue, TNode, Value } from '../types/domain';
|
|
2
2
|
export type ReferrerPolicy = 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
|
|
3
3
|
export interface IFrameOptions {
|
|
4
4
|
/**
|
|
@@ -12,11 +12,11 @@ export interface IFrameOptions {
|
|
|
12
12
|
/**
|
|
13
13
|
* The width of the iframe.
|
|
14
14
|
*/
|
|
15
|
-
width?:
|
|
15
|
+
width?: SplitValue<string | number>;
|
|
16
16
|
/**
|
|
17
17
|
* The height of the iframe.
|
|
18
18
|
*/
|
|
19
|
-
height?:
|
|
19
|
+
height?: SplitValue<string | number>;
|
|
20
20
|
/**
|
|
21
21
|
* The sandbox attribute for the iframe.
|
|
22
22
|
*/
|
|
@@ -38,6 +38,10 @@ export interface IFrameOptions {
|
|
|
38
38
|
* Receives the iframe element and its contentDocument.
|
|
39
39
|
*/
|
|
40
40
|
onLoad?: (iframe: HTMLIFrameElement) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Content to attach directly to the iframe's element, not the document body.
|
|
43
|
+
*/
|
|
44
|
+
iframeChild?: TNode;
|
|
41
45
|
}
|
|
42
46
|
/**
|
|
43
47
|
* Creates an iframe element and optionally renders content into its document.
|
|
@@ -84,4 +88,4 @@ export interface IFrameOptions {
|
|
|
84
88
|
* @returns A renderable that creates and manages the iframe
|
|
85
89
|
* @public
|
|
86
90
|
*/
|
|
87
|
-
export declare function IFrame({ src, name, width, height, sandbox, allow, referrerpolicy, loading, onLoad, }?: IFrameOptions, ...children: TNode[]): import('..').Renderable;
|
|
91
|
+
export declare function IFrame({ src, name, width, height, sandbox, allow, referrerpolicy, loading, iframeChild, onLoad, }?: IFrameOptions, ...children: TNode[]): import('..').Renderable;
|
package/types/domain.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReadSignal } from '../../../tempots-core/dist/signal';
|
|
1
2
|
import { DOMContext } from '../dom/dom-context';
|
|
2
3
|
import { AnySignal, Computed, Prop, Signal, Value, ValueType, BaseValueType, ValueTypes, Values, RemoveSignals, Nil, Clear, ProviderMark, makeProviderMark, Renderable as CoreRenderable } from '@tempots/core';
|
|
3
4
|
export type { Clear, ProviderMark, ValueType, BaseValueType, ValueTypes, Values, RemoveSignals, Nil, AnySignal, };
|
|
@@ -127,7 +128,7 @@ export declare const domRenderable: <CTX extends DOMContext = DOMContext>(render
|
|
|
127
128
|
* @template CTX - The type of DOMContext (defaults to DOMContext)
|
|
128
129
|
* @public
|
|
129
130
|
*/
|
|
130
|
-
export type TNode<CTX extends DOMContext = DOMContext> = Renderable<CTX> |
|
|
131
|
+
export type TNode<CTX extends DOMContext = DOMContext> = Renderable<CTX> | string | ReadSignal<string> | undefined | null | Renderable<CTX>[];
|
|
131
132
|
/**
|
|
132
133
|
* Represents a collection of providers.
|
|
133
134
|
* The keys of the record are ProviderMark types, and the values are of unknown type.
|
|
@@ -156,6 +157,7 @@ export type Size = {
|
|
|
156
157
|
* @typeParam T - The type of the value.
|
|
157
158
|
* @public
|
|
158
159
|
*/
|
|
159
|
-
export type NValue<T> = Value<NonNullable<T>> |
|
|
160
|
+
export type NValue<T> = Value<NonNullable<T>> | ReadSignal<T> | ReadSignal<T | null> | ReadSignal<T | undefined> | ReadSignal<T | null | undefined> | null | undefined;
|
|
160
161
|
type TupleToUnion<T extends unknown[]> = T[number];
|
|
161
162
|
export type SplitNValue<T> = (T extends unknown ? TupleToUnion<NValue<T>[]> : never) | NValue<T>;
|
|
163
|
+
export type SplitValue<T> = (T extends unknown ? TupleToUnion<Value<T>[]> : never) | Value<T>;
|