@tempots/dom 34.0.0 → 34.2.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.0.0",
3
+ "version": "34.2.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.1.0"
41
41
  }
42
42
  }
@@ -0,0 +1,87 @@
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
+ /**
43
+ * Creates an iframe element and optionally renders content into its document.
44
+ *
45
+ * When children are provided, they are rendered into the iframe's contentDocument.
46
+ * This allows you to create isolated DOM contexts with their own styles and scripts.
47
+ *
48
+ * @example
49
+ * ```typescript
50
+ * // Simple iframe with src
51
+ * IFrame({ src: 'https://example.com', width: 800, height: 600 })
52
+ * ```
53
+ *
54
+ * @example
55
+ * ```typescript
56
+ * // Iframe with rendered content
57
+ * IFrame(
58
+ * { width: 800, height: 600 },
59
+ * html.div(
60
+ * html.style('body { font-family: sans-serif; }'),
61
+ * html.h1('Hello from iframe!'),
62
+ * html.p('This content is rendered inside the iframe')
63
+ * )
64
+ * )
65
+ * ```
66
+ *
67
+ * @example
68
+ * ```typescript
69
+ * // Iframe with onLoad callback
70
+ * IFrame(
71
+ * {
72
+ * width: 800,
73
+ * height: 600,
74
+ * onLoad: (iframe, doc) => {
75
+ * console.log('Iframe loaded:', doc.title)
76
+ * }
77
+ * },
78
+ * html.div('Content')
79
+ * )
80
+ * ```
81
+ *
82
+ * @param options - Configuration options for the iframe
83
+ * @param children - Optional content to render inside the iframe's document
84
+ * @returns A renderable that creates and manages the iframe
85
+ * @public
86
+ */
87
+ export declare function IFrame({ src, name, width, height, sandbox, allow, referrerpolicy, loading, onLoad, }?: IFrameOptions, ...children: TNode[]): import('..').Renderable;
@@ -0,0 +1,9 @@
1
+ import { TNode } from '../types/domain';
2
+ export interface ShadowRootOptions {
3
+ mode: 'open' | 'closed';
4
+ delegatesFocus?: boolean;
5
+ slotAssignment?: 'named' | 'manual';
6
+ clonable?: boolean;
7
+ serializable?: boolean;
8
+ }
9
+ export declare function ShadowRoot({ mode, delegatesFocus, slotAssignment, clonable, serializable, }: ShadowRootOptions, ...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