@tempots/dom 34.1.0 → 34.3.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": "34.1.0",
3
+ "version": "34.3.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": "^1.0.0"
40
+ "@tempots/core": "^1.2.0"
41
41
  }
42
42
  }
@@ -0,0 +1,91 @@
1
+ import { TNode, Value } from '../types/domain';
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
+ export interface IFrameOptions {
4
+ /**
5
+ * The URL of the page to embed in the iframe.
6
+ */
7
+ src?: Value<string>;
8
+ /**
9
+ * The name of the iframe.
10
+ */
11
+ name?: Value<string>;
12
+ /**
13
+ * The width of the iframe.
14
+ */
15
+ width?: Value<string | number>;
16
+ /**
17
+ * The height of the iframe.
18
+ */
19
+ height?: Value<string | number>;
20
+ /**
21
+ * The sandbox attribute for the iframe.
22
+ */
23
+ sandbox?: Value<string>;
24
+ /**
25
+ * The allow attribute for the iframe.
26
+ */
27
+ allow?: Value<string>;
28
+ /**
29
+ * The referrerpolicy attribute for the iframe.
30
+ */
31
+ referrerpolicy?: Value<ReferrerPolicy>;
32
+ /**
33
+ * The loading attribute for the iframe.
34
+ */
35
+ loading?: Value<'eager' | 'lazy'>;
36
+ /**
37
+ * Callback function that is called when the iframe is loaded.
38
+ * Receives the iframe element and its contentDocument.
39
+ */
40
+ onLoad?: (iframe: HTMLIFrameElement) => void;
41
+ /**
42
+ * Content to attach directly to the iframe's element, not the document body.
43
+ */
44
+ iframeChild?: TNode;
45
+ }
46
+ /**
47
+ * Creates an iframe element and optionally renders content into its document.
48
+ *
49
+ * When children are provided, they are rendered into the iframe's contentDocument.
50
+ * This allows you to create isolated DOM contexts with their own styles and scripts.
51
+ *
52
+ * @example
53
+ * ```typescript
54
+ * // Simple iframe with src
55
+ * IFrame({ src: 'https://example.com', width: 800, height: 600 })
56
+ * ```
57
+ *
58
+ * @example
59
+ * ```typescript
60
+ * // Iframe with rendered content
61
+ * IFrame(
62
+ * { width: 800, height: 600 },
63
+ * html.div(
64
+ * html.style('body { font-family: sans-serif; }'),
65
+ * html.h1('Hello from iframe!'),
66
+ * html.p('This content is rendered inside the iframe')
67
+ * )
68
+ * )
69
+ * ```
70
+ *
71
+ * @example
72
+ * ```typescript
73
+ * // Iframe with onLoad callback
74
+ * IFrame(
75
+ * {
76
+ * width: 800,
77
+ * height: 600,
78
+ * onLoad: (iframe, doc) => {
79
+ * console.log('Iframe loaded:', doc.title)
80
+ * }
81
+ * },
82
+ * html.div('Content')
83
+ * )
84
+ * ```
85
+ *
86
+ * @param options - Configuration options for the iframe
87
+ * @param children - Optional content to render inside the iframe's document
88
+ * @returns A renderable that creates and manages the iframe
89
+ * @public
90
+ */
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,7 +1,7 @@
1
1
  import { DOMContext } from '../dom/dom-context';
2
2
  import { AnySignal, Computed, Prop, Signal, Value, ValueType, BaseValueType, ValueTypes, Values, RemoveSignals, Nil, Clear, ProviderMark, makeProviderMark, Renderable as CoreRenderable } from '@tempots/core';
3
- export type { Clear, ProviderMark, Value, ValueType, BaseValueType, ValueTypes, Values, RemoveSignals, Nil, AnySignal, Signal, Prop, Computed, };
4
- export { makeProviderMark };
3
+ export type { Clear, ProviderMark, ValueType, BaseValueType, ValueTypes, Values, RemoveSignals, Nil, AnySignal, };
4
+ export { makeProviderMark, Computed, Value, Signal, Prop };
5
5
  /**
6
6
  * Symbol to brand DOM renderables and prevent mixing with other contexts
7
7
  * @public